├── CustomControls.sln
├── CustomControls
├── App.config
├── CustomControls.csproj
├── Form1.Designer.cs
├── Form1.cs
├── Form1.resx
├── Forms
│ ├── FormButton.Designer.cs
│ ├── FormButton.cs
│ ├── FormButton.resx
│ ├── FormComboBox.Designer.cs
│ ├── FormComboBox.cs
│ ├── FormComboBox.resx
│ ├── FormDatePicker.Designer.cs
│ ├── FormDatePicker.cs
│ ├── FormDatePicker.resx
│ ├── FormMiniatura.Designer.cs
│ ├── FormMiniatura.cs
│ ├── FormMiniatura.resx
│ ├── FormRadioButton.Designer.cs
│ ├── FormRadioButton.cs
│ ├── FormRadioButton.resx
│ ├── FormTextBox.Designer.cs
│ ├── FormTextBox.cs
│ ├── FormTextBox.resx
│ ├── FormToggleButton.Designer.cs
│ ├── FormToggleButton.cs
│ └── FormToggleButton.resx
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── RJControls
│ ├── MenuColorTable.cs
│ ├── MenuRenderer.cs
│ ├── RJButton.cs
│ ├── RJCircularPictureBox.cs
│ ├── RJComboBox.cs
│ ├── RJDatePicker.cs
│ ├── RJDropdownMenu.cs
│ ├── RJProgressBar.cs
│ ├── RJRadioButton.cs
│ ├── RJTextBox.Designer.cs
│ ├── RJTextBox.cs
│ ├── RJTextBox.resx
│ └── RJToggleButton.cs
├── Resources
│ ├── calendarDark.png
│ └── calendarWhite.png
├── bin
│ └── Debug
│ │ ├── CustomControls.exe
│ │ ├── CustomControls.exe.config
│ │ ├── CustomControls.pdb
│ │ ├── CustomControls.vshost.exe
│ │ ├── CustomControls.vshost.exe.config
│ │ ├── CustomControls.vshost.exe.manifest
│ │ └── FontAwesome.Sharp.dll
├── obj
│ └── Debug
│ │ └── CustomControls.csproj.AssemblyReference.cache
└── packages.config
├── LICENSE
├── README.md
└── RJControlsIcon.png
/CustomControls.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29709.97
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomControls", "CustomControls\CustomControls.csproj", "{602AA7A6-9A92-47E1-B800-2F78154EA050}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {602AA7A6-9A92-47E1-B800-2F78154EA050}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {602AA7A6-9A92-47E1-B800-2F78154EA050}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {602AA7A6-9A92-47E1-B800-2F78154EA050}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {602AA7A6-9A92-47E1-B800-2F78154EA050}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {8E342F86-E35D-4CB0-8AC7-918F657B4573}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/CustomControls/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CustomControls/CustomControls.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {602AA7A6-9A92-47E1-B800-2F78154EA050}
8 | WinExe
9 | CustomControls
10 | CustomControls
11 | v4.5
12 | 512
13 | true
14 |
15 |
16 |
17 |
18 |
19 | AnyCPU
20 | true
21 | full
22 | false
23 | bin\Debug\
24 | DEBUG;TRACE
25 | prompt
26 | 4
27 |
28 |
29 | AnyCPU
30 | pdbonly
31 | true
32 | bin\Release\
33 | TRACE
34 | prompt
35 | 4
36 |
37 |
38 |
39 | ..\packages\FontAwesome.Sharp.5.15.3\lib\net45\FontAwesome.Sharp.dll
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | Form
56 |
57 |
58 | Form1.cs
59 |
60 |
61 |
62 |
63 | Component
64 |
65 |
66 | UserControl
67 |
68 |
69 | Form
70 |
71 |
72 | FormButton.cs
73 |
74 |
75 | Form
76 |
77 |
78 | FormComboBox.cs
79 |
80 |
81 | Form
82 |
83 |
84 | FormDatePicker.cs
85 |
86 |
87 | Form
88 |
89 |
90 | FormMiniatura.cs
91 |
92 |
93 | Form
94 |
95 |
96 | FormRadioButton.cs
97 |
98 |
99 | Form
100 |
101 |
102 | FormTextBox.cs
103 |
104 |
105 |
106 |
107 | Component
108 |
109 |
110 | Component
111 |
112 |
113 | Component
114 |
115 |
116 | Component
117 |
118 |
119 | Component
120 |
121 |
122 | UserControl
123 |
124 |
125 | RJTextBox.cs
126 |
127 |
128 | Component
129 |
130 |
131 | Form
132 |
133 |
134 | FormToggleButton.cs
135 |
136 |
137 | Form1.cs
138 |
139 |
140 | FormButton.cs
141 |
142 |
143 | FormComboBox.cs
144 |
145 |
146 | FormDatePicker.cs
147 |
148 |
149 | FormMiniatura.cs
150 |
151 |
152 | FormRadioButton.cs
153 |
154 |
155 | FormTextBox.cs
156 |
157 |
158 | ResXFileCodeGenerator
159 | Resources.Designer.cs
160 | Designer
161 |
162 |
163 | True
164 | Resources.resx
165 | True
166 |
167 |
168 | RJTextBox.cs
169 |
170 |
171 | FormToggleButton.cs
172 |
173 |
174 |
175 | SettingsSingleFileGenerator
176 | Settings.Designer.cs
177 |
178 |
179 | True
180 | Settings.settings
181 | True
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
--------------------------------------------------------------------------------
/CustomControls/Form1.cs:
--------------------------------------------------------------------------------
1 | using CustomControls.RJControls;
2 | using CustomControls.Testing;
3 | using Microsoft.Win32;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.ComponentModel;
7 | using System.Data;
8 | using System.Drawing;
9 | using System.Linq;
10 | using System.Text;
11 | using System.Threading.Tasks;
12 | using System.Windows.Forms;
13 |
14 | namespace CustomControls
15 | {
16 | public partial class Form1 : Form
17 | {
18 | public Form1()
19 | {
20 | InitializeComponent();
21 | //rjTextBox1.Texts = "animal";
22 | }
23 |
24 | private void Form1_Load(object sender, EventArgs e)
25 | {
26 |
27 | rjDropdownMenu2.PrimaryColor = Color.CornflowerBlue;
28 | rjDropdownMenu6.PrimaryColor = Color.Orange;
29 | rjDropdownMenu7.PrimaryColor = Color.MediumSeaGreen;
30 |
31 | rjDropdownMenu3.PrimaryColor = Color.SeaGreen;
32 | rjDropdownMenu3.MenuItemTextColor = Color.SeaGreen;
33 | rjDropdownMenu3.MenuItemHeight = 30;
34 |
35 | rjDropdownMenu4.PrimaryColor = Color.HotPink;
36 | rjDropdownMenu4.MenuItemHeight = 25;
37 |
38 | rjDropdownMenu5.PrimaryColor = Color.Gold;
39 | rjDropdownMenu5.MenuItemTextColor = Color.SteelBlue;
40 | rjDropdownMenu5.MenuItemHeight = 50;
41 |
42 | rjDropdownMenu1.IsMainMenu = true;
43 | rjDropdownMenu2.IsMainMenu = true;
44 | rjDropdownMenu6.IsMainMenu = true;
45 | rjDropdownMenu7.IsMainMenu = true;
46 | }
47 |
48 | private void rjButton1_Click(object sender, EventArgs e)
49 | {
50 | rjDropdownMenu3.Show(rjButton1, rjButton1.Width, 0);
51 | }
52 |
53 | private void rjButton2_Click(object sender, EventArgs e)
54 | {
55 | rjDropdownMenu4.Show(rjButton2, rjButton2.Width, 0);
56 | }
57 |
58 | private void rjButton3_Click(object sender, EventArgs e)
59 | {
60 | rjDropdownMenu5.Show(rjButton3, rjButton3.Width, 0);
61 | }
62 |
63 | private void iconButton1_Click(object sender, EventArgs e)
64 | {
65 | Open_DropdownMenu(rjDropdownMenu1, sender);
66 | }
67 |
68 | private void iconButton2_Click(object sender, EventArgs e)
69 | {
70 | Open_DropdownMenu(rjDropdownMenu2, sender);
71 | }
72 |
73 | private void iconButton3_Click(object sender, EventArgs e)
74 | {
75 | Open_DropdownMenu2(rjDropdownMenu6, sender);
76 | }
77 |
78 | private void iconButton4_Click(object sender, EventArgs e)
79 | {
80 | Open_DropdownMenu2(rjDropdownMenu7, sender);
81 |
82 | }
83 |
84 | private void Open_DropdownMenu(RJDropdownMenu dropdownMenu, object sender)
85 | {
86 | Control control = (Control)sender;
87 | dropdownMenu.VisibleChanged += new EventHandler((sender2, ev)
88 | => DropdownMenu_VisibleChanged(sender2, ev, control));
89 | dropdownMenu.Show(control, control.Width, 0);
90 | }
91 |
92 | private void Open_DropdownMenu2(RJDropdownMenu dropdownMenu, object sender)
93 | {
94 | Control control = (Control)sender;
95 | dropdownMenu.VisibleChanged += new EventHandler((sender2, ev)
96 | => DropdownMenu_VisibleChanged(sender2, ev, control));
97 | dropdownMenu.Show(control, control.Width - dropdownMenu.Width, control.Height);
98 | }
99 |
100 | private void DropdownMenu_VisibleChanged(object sender, EventArgs e, Control ctrl)
101 | {
102 | RJDropdownMenu dropdownMenu = (RJDropdownMenu)sender;
103 | if (!DesignMode)
104 | {
105 | if (dropdownMenu.Visible)
106 | ctrl.BackColor = Color.FromArgb(72, 52, 183);
107 | else ctrl.BackColor = Color.FromArgb(24, 24, 36);
108 |
109 | }
110 | }
111 |
112 | private void rjButton4_Click(object sender, EventArgs e)
113 | {
114 | MessageBox.Show(rjTextBox1.Texts);
115 | }
116 |
117 | private void rjButton5_Click(object sender, EventArgs e)
118 | {
119 | MessageBox.Show(rjTextBox1.PlaceholderText);
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/CustomControls/Forms/FormButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace CustomControls.Test
12 | {
13 | public partial class FormButton : Form
14 | {
15 | public FormButton()
16 | {
17 | InitializeComponent();
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/CustomControls/Forms/FormComboBox.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace CustomControls.Test
12 | {
13 | public partial class FormComboBox : Form
14 | {
15 | public FormComboBox()
16 | {
17 | InitializeComponent();
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/CustomControls/Forms/FormComboBox.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/CustomControls/Forms/FormDatePicker.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace CustomControls.Testing
2 | {
3 | partial class FormDatePicker
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormDatePicker));
32 | this.panel1 = new System.Windows.Forms.Panel();
33 | this.label1 = new System.Windows.Forms.Label();
34 | this.rjDatePicker3 = new CustomControls.RJControls.RJDatePicker();
35 | this.rjDatePicker5 = new CustomControls.RJControls.RJDatePicker();
36 | this.rjDatePicker6 = new CustomControls.RJControls.RJDatePicker();
37 | this.rjDatePicker4 = new CustomControls.RJControls.RJDatePicker();
38 | this.rjDatePicker2 = new CustomControls.RJControls.RJDatePicker();
39 | this.rjDatePicker1 = new CustomControls.RJControls.RJDatePicker();
40 | this.panel1.SuspendLayout();
41 | this.SuspendLayout();
42 | //
43 | // panel1
44 | //
45 | this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(124)))), ((int)(((byte)(252)))));
46 | this.panel1.Controls.Add(this.label1);
47 | this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
48 | this.panel1.Location = new System.Drawing.Point(0, 0);
49 | this.panel1.Name = "panel1";
50 | this.panel1.Size = new System.Drawing.Size(738, 50);
51 | this.panel1.TabIndex = 25;
52 | //
53 | // label1
54 | //
55 | this.label1.AutoSize = true;
56 | this.label1.Font = new System.Drawing.Font("Montserrat", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
57 | this.label1.ForeColor = System.Drawing.Color.White;
58 | this.label1.Location = new System.Drawing.Point(89, 9);
59 | this.label1.Name = "label1";
60 | this.label1.Size = new System.Drawing.Size(542, 33);
61 | this.label1.TabIndex = 0;
62 | this.label1.Text = "Custom DateTimePicker - C# WinForm";
63 | //
64 | // rjDatePicker3
65 | //
66 | this.rjDatePicker3.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(166)))), ((int)(((byte)(35)))));
67 | this.rjDatePicker3.BorderSize = 3;
68 | this.rjDatePicker3.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F);
69 | this.rjDatePicker3.Location = new System.Drawing.Point(407, 239);
70 | this.rjDatePicker3.MinimumSize = new System.Drawing.Size(4, 35);
71 | this.rjDatePicker3.Name = "rjDatePicker3";
72 | this.rjDatePicker3.Size = new System.Drawing.Size(246, 35);
73 | this.rjDatePicker3.SkinColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(42)))), ((int)(((byte)(85)))));
74 | this.rjDatePicker3.TabIndex = 31;
75 | this.rjDatePicker3.TextColor = System.Drawing.Color.LightGray;
76 | //
77 | // rjDatePicker5
78 | //
79 | this.rjDatePicker5.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(197)))), ((int)(((byte)(146)))), ((int)(((byte)(241)))));
80 | this.rjDatePicker5.BorderSize = 2;
81 | this.rjDatePicker5.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F);
82 | this.rjDatePicker5.Format = System.Windows.Forms.DateTimePickerFormat.Short;
83 | this.rjDatePicker5.Location = new System.Drawing.Point(407, 183);
84 | this.rjDatePicker5.MinimumSize = new System.Drawing.Size(4, 35);
85 | this.rjDatePicker5.Name = "rjDatePicker5";
86 | this.rjDatePicker5.Size = new System.Drawing.Size(151, 35);
87 | this.rjDatePicker5.SkinColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(42)))), ((int)(((byte)(85)))));
88 | this.rjDatePicker5.TabIndex = 30;
89 | this.rjDatePicker5.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
90 | //
91 | // rjDatePicker6
92 | //
93 | this.rjDatePicker6.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(155)))), ((int)(((byte)(239)))));
94 | this.rjDatePicker6.BorderSize = 1;
95 | this.rjDatePicker6.CustomFormat = "MMMM dd, yyy";
96 | this.rjDatePicker6.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F);
97 | this.rjDatePicker6.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
98 | this.rjDatePicker6.Location = new System.Drawing.Point(407, 125);
99 | this.rjDatePicker6.MinimumSize = new System.Drawing.Size(4, 35);
100 | this.rjDatePicker6.Name = "rjDatePicker6";
101 | this.rjDatePicker6.Size = new System.Drawing.Size(190, 35);
102 | this.rjDatePicker6.SkinColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(42)))), ((int)(((byte)(85)))));
103 | this.rjDatePicker6.TabIndex = 29;
104 | this.rjDatePicker6.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(155)))), ((int)(((byte)(239)))));
105 | //
106 | // rjDatePicker4
107 | //
108 | this.rjDatePicker4.BorderColor = System.Drawing.Color.PaleVioletRed;
109 | this.rjDatePicker4.BorderSize = 0;
110 | this.rjDatePicker4.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F);
111 | this.rjDatePicker4.Location = new System.Drawing.Point(82, 239);
112 | this.rjDatePicker4.MinimumSize = new System.Drawing.Size(4, 35);
113 | this.rjDatePicker4.Name = "rjDatePicker4";
114 | this.rjDatePicker4.Size = new System.Drawing.Size(271, 35);
115 | this.rjDatePicker4.SkinColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(177)))), ((int)(((byte)(241)))));
116 | this.rjDatePicker4.TabIndex = 28;
117 | this.rjDatePicker4.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
118 | this.rjDatePicker4.Value = new System.DateTime(2021, 2, 17, 0, 0, 0, 0);
119 | //
120 | // rjDatePicker2
121 | //
122 | this.rjDatePicker2.BorderColor = System.Drawing.Color.PaleVioletRed;
123 | this.rjDatePicker2.BorderSize = 0;
124 | this.rjDatePicker2.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F);
125 | this.rjDatePicker2.Location = new System.Drawing.Point(82, 183);
126 | this.rjDatePicker2.MinimumSize = new System.Drawing.Size(4, 35);
127 | this.rjDatePicker2.Name = "rjDatePicker2";
128 | this.rjDatePicker2.Size = new System.Drawing.Size(271, 35);
129 | this.rjDatePicker2.SkinColor = System.Drawing.Color.FromArgb(((int)(((byte)(110)))), ((int)(((byte)(63)))), ((int)(((byte)(219)))));
130 | this.rjDatePicker2.TabIndex = 27;
131 | this.rjDatePicker2.TextColor = System.Drawing.Color.White;
132 | this.rjDatePicker2.Value = new System.DateTime(2019, 12, 12, 0, 0, 0, 0);
133 | //
134 | // rjDatePicker1
135 | //
136 | this.rjDatePicker1.BorderColor = System.Drawing.Color.PaleVioletRed;
137 | this.rjDatePicker1.BorderSize = 0;
138 | this.rjDatePicker1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F);
139 | this.rjDatePicker1.Location = new System.Drawing.Point(107, 125);
140 | this.rjDatePicker1.MinimumSize = new System.Drawing.Size(4, 35);
141 | this.rjDatePicker1.Name = "rjDatePicker1";
142 | this.rjDatePicker1.Size = new System.Drawing.Size(246, 35);
143 | this.rjDatePicker1.SkinColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(162)))), ((int)(((byte)(243)))));
144 | this.rjDatePicker1.TabIndex = 26;
145 | this.rjDatePicker1.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
146 | //
147 | // FormDatePicker
148 | //
149 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
150 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
151 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(42)))), ((int)(((byte)(85)))));
152 | this.ClientSize = new System.Drawing.Size(738, 428);
153 | this.Controls.Add(this.rjDatePicker3);
154 | this.Controls.Add(this.rjDatePicker5);
155 | this.Controls.Add(this.rjDatePicker6);
156 | this.Controls.Add(this.rjDatePicker4);
157 | this.Controls.Add(this.rjDatePicker2);
158 | this.Controls.Add(this.rjDatePicker1);
159 | this.Controls.Add(this.panel1);
160 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
161 | this.Name = "FormDatePicker";
162 | this.Text = "Custom Controls";
163 | this.panel1.ResumeLayout(false);
164 | this.panel1.PerformLayout();
165 | this.ResumeLayout(false);
166 |
167 | }
168 |
169 | #endregion
170 | private System.Windows.Forms.Panel panel1;
171 | private System.Windows.Forms.Label label1;
172 | private RJControls.RJDatePicker rjDatePicker1;
173 | private RJControls.RJDatePicker rjDatePicker2;
174 | private RJControls.RJDatePicker rjDatePicker4;
175 | private RJControls.RJDatePicker rjDatePicker3;
176 | private RJControls.RJDatePicker rjDatePicker5;
177 | private RJControls.RJDatePicker rjDatePicker6;
178 | }
179 | }
--------------------------------------------------------------------------------
/CustomControls/Forms/FormDatePicker.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace CustomControls.Testing
12 | {
13 | public partial class FormDatePicker : Form
14 | {
15 | public FormDatePicker()
16 | {
17 | InitializeComponent();
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/CustomControls/Forms/FormMiniatura.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace CustomControls.Testing
2 | {
3 | partial class FormMiniatura
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMiniatura));
33 | this.panel1 = new System.Windows.Forms.Panel();
34 | this.label1 = new System.Windows.Forms.Label();
35 | this.label2 = new System.Windows.Forms.Label();
36 | this.label3 = new System.Windows.Forms.Label();
37 | this.label4 = new System.Windows.Forms.Label();
38 | this.label5 = new System.Windows.Forms.Label();
39 | this.label6 = new System.Windows.Forms.Label();
40 | this.rjProgressBar5 = new CustomControls.RJControls.RJProgressBar();
41 | this.rjProgressBar4 = new CustomControls.RJControls.RJProgressBar();
42 | this.rjProgressBar3 = new CustomControls.RJControls.RJProgressBar();
43 | this.rjProgressBar2 = new CustomControls.RJControls.RJProgressBar();
44 | this.rjProgressBar1 = new CustomControls.RJControls.RJProgressBar();
45 | this.rjButton1 = new CustomControls.RJControls.RJButton();
46 | this.timer1 = new System.Windows.Forms.Timer(this.components);
47 | this.panel1.SuspendLayout();
48 | this.SuspendLayout();
49 | //
50 | // panel1
51 | //
52 | this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(174)))), ((int)(((byte)(175)))));
53 | this.panel1.Controls.Add(this.label1);
54 | this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
55 | this.panel1.Location = new System.Drawing.Point(0, 0);
56 | this.panel1.Name = "panel1";
57 | this.panel1.Size = new System.Drawing.Size(1278, 80);
58 | this.panel1.TabIndex = 26;
59 | //
60 | // label1
61 | //
62 | this.label1.AutoSize = true;
63 | this.label1.Font = new System.Drawing.Font("Verdana", 45F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
64 | this.label1.ForeColor = System.Drawing.Color.Black;
65 | this.label1.Location = new System.Drawing.Point(79, 4);
66 | this.label1.Name = "label1";
67 | this.label1.Size = new System.Drawing.Size(1091, 73);
68 | this.label1.TabIndex = 0;
69 | this.label1.Text = "Custom ProgressBar - C# WinForm";
70 | //
71 | // label2
72 | //
73 | this.label2.AutoSize = true;
74 | this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
75 | this.label2.ForeColor = System.Drawing.Color.LightSlateGray;
76 | this.label2.Location = new System.Drawing.Point(130, 175);
77 | this.label2.Name = "label2";
78 | this.label2.Size = new System.Drawing.Size(191, 46);
79 | this.label2.TabIndex = 37;
80 | this.label2.Text = "Left value";
81 | //
82 | // label3
83 | //
84 | this.label3.AutoSize = true;
85 | this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
86 | this.label3.ForeColor = System.Drawing.Color.LightSlateGray;
87 | this.label3.Location = new System.Drawing.Point(103, 278);
88 | this.label3.Name = "label3";
89 | this.label3.Size = new System.Drawing.Size(218, 46);
90 | this.label3.TabIndex = 38;
91 | this.label3.Text = "Right value";
92 | //
93 | // label4
94 | //
95 | this.label4.AutoSize = true;
96 | this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
97 | this.label4.ForeColor = System.Drawing.Color.LightSlateGray;
98 | this.label4.Location = new System.Drawing.Point(77, 408);
99 | this.label4.Name = "label4";
100 | this.label4.Size = new System.Drawing.Size(244, 46);
101 | this.label4.TabIndex = 39;
102 | this.label4.Text = "Center value";
103 | //
104 | // label5
105 | //
106 | this.label5.AutoSize = true;
107 | this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
108 | this.label5.ForeColor = System.Drawing.Color.LightSlateGray;
109 | this.label5.Location = new System.Drawing.Point(76, 558);
110 | this.label5.Name = "label5";
111 | this.label5.Size = new System.Drawing.Size(245, 46);
112 | this.label5.TabIndex = 40;
113 | this.label5.Text = "Slidind value";
114 | //
115 | // label6
116 | //
117 | this.label6.AutoSize = true;
118 | this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
119 | this.label6.ForeColor = System.Drawing.Color.LightSlateGray;
120 | this.label6.Location = new System.Drawing.Point(24, 642);
121 | this.label6.Name = "label6";
122 | this.label6.Size = new System.Drawing.Size(297, 46);
123 | this.label6.TabIndex = 41;
124 | this.label6.Text = "Show NO value";
125 | //
126 | // rjProgressBar5
127 | //
128 | this.rjProgressBar5.ChannelColor = System.Drawing.Color.LightSlateGray;
129 | this.rjProgressBar5.ChannelHeight = 30;
130 | this.rjProgressBar5.Font = new System.Drawing.Font("Microsoft Sans Serif", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
131 | this.rjProgressBar5.ForeBackColor = System.Drawing.Color.WhiteSmoke;
132 | this.rjProgressBar5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
133 | this.rjProgressBar5.Location = new System.Drawing.Point(327, 637);
134 | this.rjProgressBar5.Name = "rjProgressBar5";
135 | this.rjProgressBar5.ShowMaximun = false;
136 | this.rjProgressBar5.ShowValue = CustomControls.RJControls.TextPosition.None;
137 | this.rjProgressBar5.Size = new System.Drawing.Size(843, 51);
138 | this.rjProgressBar5.SliderColor = System.Drawing.Color.MediumSeaGreen;
139 | this.rjProgressBar5.SliderHeight = 30;
140 | this.rjProgressBar5.SymbolAfter = "";
141 | this.rjProgressBar5.SymbolBefore = "";
142 | this.rjProgressBar5.TabIndex = 36;
143 | this.rjProgressBar5.Value = 20;
144 | //
145 | // rjProgressBar4
146 | //
147 | this.rjProgressBar4.ChannelColor = System.Drawing.Color.LightSteelBlue;
148 | this.rjProgressBar4.ChannelHeight = 20;
149 | this.rjProgressBar4.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
150 | this.rjProgressBar4.ForeBackColor = System.Drawing.Color.CornflowerBlue;
151 | this.rjProgressBar4.ForeColor = System.Drawing.Color.White;
152 | this.rjProgressBar4.Location = new System.Drawing.Point(327, 496);
153 | this.rjProgressBar4.Maximum = 500;
154 | this.rjProgressBar4.Name = "rjProgressBar4";
155 | this.rjProgressBar4.ShowMaximun = false;
156 | this.rjProgressBar4.ShowValue = CustomControls.RJControls.TextPosition.Sliding;
157 | this.rjProgressBar4.Size = new System.Drawing.Size(843, 108);
158 | this.rjProgressBar4.SliderColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
159 | this.rjProgressBar4.SliderHeight = 50;
160 | this.rjProgressBar4.SymbolAfter = "";
161 | this.rjProgressBar4.SymbolBefore = "$";
162 | this.rjProgressBar4.TabIndex = 35;
163 | this.rjProgressBar4.Value = 384;
164 | //
165 | // rjProgressBar3
166 | //
167 | this.rjProgressBar3.ChannelColor = System.Drawing.Color.Navy;
168 | this.rjProgressBar3.ChannelHeight = 50;
169 | this.rjProgressBar3.Font = new System.Drawing.Font("Microsoft Sans Serif", 32F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
170 | this.rjProgressBar3.ForeBackColor = System.Drawing.Color.WhiteSmoke;
171 | this.rjProgressBar3.ForeColor = System.Drawing.Color.Salmon;
172 | this.rjProgressBar3.Location = new System.Drawing.Point(327, 350);
173 | this.rjProgressBar3.MarqueeAnimationSpeed = 0;
174 | this.rjProgressBar3.Maximum = 1280;
175 | this.rjProgressBar3.Name = "rjProgressBar3";
176 | this.rjProgressBar3.ShowMaximun = true;
177 | this.rjProgressBar3.ShowValue = CustomControls.RJControls.TextPosition.Center;
178 | this.rjProgressBar3.Size = new System.Drawing.Size(843, 104);
179 | this.rjProgressBar3.SliderColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
180 | this.rjProgressBar3.SliderHeight = 30;
181 | this.rjProgressBar3.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
182 | this.rjProgressBar3.SymbolAfter = "";
183 | this.rjProgressBar3.SymbolBefore = "$";
184 | this.rjProgressBar3.TabIndex = 34;
185 | this.rjProgressBar3.Value = 498;
186 | //
187 | // rjProgressBar2
188 | //
189 | this.rjProgressBar2.ChannelColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(89)))), ((int)(((byte)(132)))));
190 | this.rjProgressBar2.ChannelHeight = 20;
191 | this.rjProgressBar2.Font = new System.Drawing.Font("Microsoft Sans Serif", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
192 | this.rjProgressBar2.ForeBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
193 | this.rjProgressBar2.ForeColor = System.Drawing.Color.White;
194 | this.rjProgressBar2.Location = new System.Drawing.Point(327, 241);
195 | this.rjProgressBar2.Name = "rjProgressBar2";
196 | this.rjProgressBar2.ShowMaximun = false;
197 | this.rjProgressBar2.ShowValue = CustomControls.RJControls.TextPosition.Right;
198 | this.rjProgressBar2.Size = new System.Drawing.Size(843, 83);
199 | this.rjProgressBar2.SliderColor = System.Drawing.Color.DeepPink;
200 | this.rjProgressBar2.SliderHeight = 20;
201 | this.rjProgressBar2.SymbolAfter = "%";
202 | this.rjProgressBar2.SymbolBefore = "";
203 | this.rjProgressBar2.TabIndex = 33;
204 | this.rjProgressBar2.Value = 74;
205 | //
206 | // rjProgressBar1
207 | //
208 | this.rjProgressBar1.ChannelColor = System.Drawing.Color.LightSteelBlue;
209 | this.rjProgressBar1.ChannelHeight = 20;
210 | this.rjProgressBar1.Font = new System.Drawing.Font("Microsoft Sans Serif", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
211 | this.rjProgressBar1.ForeBackColor = System.Drawing.Color.WhiteSmoke;
212 | this.rjProgressBar1.ForeColor = System.Drawing.Color.CornflowerBlue;
213 | this.rjProgressBar1.Location = new System.Drawing.Point(327, 123);
214 | this.rjProgressBar1.Maximum = 200;
215 | this.rjProgressBar1.Name = "rjProgressBar1";
216 | this.rjProgressBar1.ShowMaximun = true;
217 | this.rjProgressBar1.ShowValue = CustomControls.RJControls.TextPosition.Left;
218 | this.rjProgressBar1.Size = new System.Drawing.Size(843, 98);
219 | this.rjProgressBar1.SliderColor = System.Drawing.Color.RoyalBlue;
220 | this.rjProgressBar1.SliderHeight = 40;
221 | this.rjProgressBar1.SymbolAfter = "";
222 | this.rjProgressBar1.SymbolBefore = "";
223 | this.rjProgressBar1.TabIndex = 32;
224 | this.rjProgressBar1.Value = 70;
225 | //
226 | // rjButton1
227 | //
228 | this.rjButton1.BackColor = System.Drawing.Color.MediumSlateBlue;
229 | this.rjButton1.BackgroundColor = System.Drawing.Color.MediumSlateBlue;
230 | this.rjButton1.BorderColor = System.Drawing.Color.PaleVioletRed;
231 | this.rjButton1.BorderRadius = 20;
232 | this.rjButton1.BorderSize = 0;
233 | this.rjButton1.FlatAppearance.BorderSize = 0;
234 | this.rjButton1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
235 | this.rjButton1.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
236 | this.rjButton1.ForeColor = System.Drawing.Color.White;
237 | this.rjButton1.Location = new System.Drawing.Point(12, 86);
238 | this.rjButton1.Name = "rjButton1";
239 | this.rjButton1.Size = new System.Drawing.Size(118, 40);
240 | this.rjButton1.TabIndex = 42;
241 | this.rjButton1.Text = "Start";
242 | this.rjButton1.TextColor = System.Drawing.Color.White;
243 | this.rjButton1.UseVisualStyleBackColor = false;
244 | this.rjButton1.Click += new System.EventHandler(this.rjButton1_Click);
245 | //
246 | // timer1
247 | //
248 | this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
249 | //
250 | // FormMiniatura
251 | //
252 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
253 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
254 | this.BackColor = System.Drawing.Color.WhiteSmoke;
255 | this.ClientSize = new System.Drawing.Size(1278, 730);
256 | this.Controls.Add(this.rjButton1);
257 | this.Controls.Add(this.label6);
258 | this.Controls.Add(this.label5);
259 | this.Controls.Add(this.label4);
260 | this.Controls.Add(this.label3);
261 | this.Controls.Add(this.label2);
262 | this.Controls.Add(this.rjProgressBar5);
263 | this.Controls.Add(this.rjProgressBar4);
264 | this.Controls.Add(this.rjProgressBar3);
265 | this.Controls.Add(this.rjProgressBar2);
266 | this.Controls.Add(this.rjProgressBar1);
267 | this.Controls.Add(this.panel1);
268 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
269 | this.Name = "FormMiniatura";
270 | this.Text = "Custom Controls";
271 | this.Load += new System.EventHandler(this.FormMiniatura_Load);
272 | this.panel1.ResumeLayout(false);
273 | this.panel1.PerformLayout();
274 | this.ResumeLayout(false);
275 | this.PerformLayout();
276 |
277 | }
278 |
279 | #endregion
280 |
281 | private System.Windows.Forms.Panel panel1;
282 | private System.Windows.Forms.Label label1;
283 | private RJControls.RJProgressBar rjProgressBar5;
284 | private RJControls.RJProgressBar rjProgressBar4;
285 | private RJControls.RJProgressBar rjProgressBar3;
286 | private RJControls.RJProgressBar rjProgressBar2;
287 | private RJControls.RJProgressBar rjProgressBar1;
288 | private System.Windows.Forms.Label label2;
289 | private System.Windows.Forms.Label label3;
290 | private System.Windows.Forms.Label label4;
291 | private System.Windows.Forms.Label label5;
292 | private System.Windows.Forms.Label label6;
293 | private RJControls.RJButton rjButton1;
294 | private System.Windows.Forms.Timer timer1;
295 | }
296 | }
--------------------------------------------------------------------------------
/CustomControls/Forms/FormMiniatura.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Runtime.InteropServices;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 | using System.Windows.Forms;
11 |
12 | namespace CustomControls.Testing
13 | {
14 | public partial class FormMiniatura : Form
15 | {
16 | public FormMiniatura()
17 | {
18 | InitializeComponent();
19 | }
20 |
21 | private void FormMiniatura_Load(object sender, EventArgs e)
22 | {
23 |
24 | }
25 |
26 | private void timer1_Tick(object sender, EventArgs e)
27 | {
28 | if (rjProgressBar1.Value < rjProgressBar1.Maximum)
29 | rjProgressBar1.Value++;
30 | if (rjProgressBar2.Value < rjProgressBar2.Maximum)
31 | rjProgressBar2.Value++;
32 | if (rjProgressBar3.Value < rjProgressBar3.Maximum)
33 | rjProgressBar3.Value++;
34 | if (rjProgressBar4.Value < rjProgressBar4.Maximum)
35 | rjProgressBar4.Value++;
36 | if (rjProgressBar5.Value < rjProgressBar5.Maximum)
37 | rjProgressBar5.Value++;
38 | }
39 |
40 | private void rjButton1_Click(object sender, EventArgs e)
41 | {
42 | rjProgressBar1.Value = 0;
43 | rjProgressBar2.Value = 0;
44 | rjProgressBar3.Value = 0;
45 | rjProgressBar4.Value = 0;
46 | rjProgressBar5.Value = 0;
47 | timer1.Start();
48 | }
49 | }
50 | }
--------------------------------------------------------------------------------
/CustomControls/Forms/FormRadioButton.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace CustomControls.Testing
2 | {
3 | partial class FormRadioButton
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormRadioButton));
32 | // this.label1 = new System.Windows.Forms.Label();
33 | // this.panel1 = new System.Windows.Forms.Panel();
34 | // this.rjRadioButton21 = new CustomControls.RJControls.RJRadioButton2();
35 | // this.rjRadioButton22 = new CustomControls.RJControls.RJRadioButton2();
36 | // this.rjRadioButton23 = new CustomControls.RJControls.RJRadioButton2();
37 | // this.rjRadioButton24 = new CustomControls.RJControls.RJRadioButton2();
38 | // this.rjRadioButton25 = new CustomControls.RJControls.RJRadioButton2();
39 | // this.panel1.SuspendLayout();
40 | // this.SuspendLayout();
41 | // //
42 | // // label1
43 | // //
44 | // this.label1.AutoSize = true;
45 | // this.label1.Font = new System.Drawing.Font("Montserrat", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
46 | // this.label1.ForeColor = System.Drawing.Color.White;
47 | // this.label1.Location = new System.Drawing.Point(230, 8);
48 | // this.label1.Name = "label1";
49 | // this.label1.Size = new System.Drawing.Size(499, 33);
50 | // this.label1.TabIndex = 0;
51 | // this.label1.Text = "Custom RadioButton - C# WinForm";
52 | // //
53 | // // panel1
54 | // //
55 | // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(177)))));
56 | // this.panel1.Controls.Add(this.label1);
57 | // this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
58 | // this.panel1.Location = new System.Drawing.Point(0, 0);
59 | // this.panel1.Name = "panel1";
60 | // this.panel1.Size = new System.Drawing.Size(984, 50);
61 | // this.panel1.TabIndex = 23;
62 | // //
63 | // // rjRadioButton21
64 | // //
65 | // this.rjRadioButton21.AutoSize = true;
66 | // this.rjRadioButton21.CheckedColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(151)))), ((int)(((byte)(109)))));
67 | // this.rjRadioButton21.Cursor = System.Windows.Forms.Cursors.Hand;
68 | // this.rjRadioButton21.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F);
69 | // this.rjRadioButton21.ForeColor = System.Drawing.Color.SteelBlue;
70 | // this.rjRadioButton21.Location = new System.Drawing.Point(56, 95);
71 | // this.rjRadioButton21.MinimumSize = new System.Drawing.Size(0, 21);
72 | // this.rjRadioButton21.Name = "rjRadioButton21";
73 | // this.rjRadioButton21.Padding = new System.Windows.Forms.Padding(30, 0, 0, 0);
74 | // this.rjRadioButton21.Size = new System.Drawing.Size(167, 35);
75 | // this.rjRadioButton21.TabIndex = 25;
76 | // this.rjRadioButton21.TabStop = true;
77 | // this.rjRadioButton21.Text = "Option A";
78 | // this.rjRadioButton21.UnCheckedColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
79 | // this.rjRadioButton21.UseVisualStyleBackColor = true;
80 | // //
81 | // // rjRadioButton22
82 | // //
83 | // this.rjRadioButton22.AutoSize = true;
84 | // this.rjRadioButton22.CheckedColor = System.Drawing.Color.FromArgb(((int)(((byte)(4)))), ((int)(((byte)(174)))), ((int)(((byte)(217)))));
85 | // this.rjRadioButton22.Cursor = System.Windows.Forms.Cursors.Hand;
86 | // this.rjRadioButton22.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F);
87 | // this.rjRadioButton22.ForeColor = System.Drawing.Color.SteelBlue;
88 | // this.rjRadioButton22.Location = new System.Drawing.Point(56, 158);
89 | // this.rjRadioButton22.MinimumSize = new System.Drawing.Size(0, 21);
90 | // this.rjRadioButton22.Name = "rjRadioButton22";
91 | // this.rjRadioButton22.Padding = new System.Windows.Forms.Padding(30, 0, 0, 0);
92 | // this.rjRadioButton22.Size = new System.Drawing.Size(167, 35);
93 | // this.rjRadioButton22.TabIndex = 26;
94 | // this.rjRadioButton22.TabStop = true;
95 | // this.rjRadioButton22.Text = "Option B";
96 | // this.rjRadioButton22.UnCheckedColor = System.Drawing.Color.FromArgb(((int)(((byte)(148)))), ((int)(((byte)(97)))), ((int)(((byte)(255)))));
97 | // this.rjRadioButton22.UseVisualStyleBackColor = true;
98 | // //
99 | // // rjRadioButton23
100 | // //
101 | // this.rjRadioButton23.AutoSize = true;
102 | // this.rjRadioButton23.CheckedColor = System.Drawing.Color.FromArgb(((int)(((byte)(148)))), ((int)(((byte)(97)))), ((int)(((byte)(255)))));
103 | // this.rjRadioButton23.Cursor = System.Windows.Forms.Cursors.Hand;
104 | // this.rjRadioButton23.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F);
105 | // this.rjRadioButton23.ForeColor = System.Drawing.Color.SlateGray;
106 | // this.rjRadioButton23.Location = new System.Drawing.Point(56, 283);
107 | // this.rjRadioButton23.MinimumSize = new System.Drawing.Size(0, 21);
108 | // this.rjRadioButton23.Name = "rjRadioButton23";
109 | // this.rjRadioButton23.Padding = new System.Windows.Forms.Padding(30, 0, 0, 0);
110 | // this.rjRadioButton23.Size = new System.Drawing.Size(169, 35);
111 | // this.rjRadioButton23.TabIndex = 28;
112 | // this.rjRadioButton23.TabStop = true;
113 | // this.rjRadioButton23.Text = "Option D";
114 | // this.rjRadioButton23.UnCheckedColor = System.Drawing.Color.FromArgb(((int)(((byte)(4)))), ((int)(((byte)(174)))), ((int)(((byte)(217)))));
115 | // this.rjRadioButton23.UseVisualStyleBackColor = true;
116 | // //
117 | // // rjRadioButton24
118 | // //
119 | // this.rjRadioButton24.AutoSize = true;
120 | // this.rjRadioButton24.CheckedColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(29)))), ((int)(((byte)(108)))));
121 | // this.rjRadioButton24.Cursor = System.Windows.Forms.Cursors.Hand;
122 | // this.rjRadioButton24.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F);
123 | // this.rjRadioButton24.ForeColor = System.Drawing.Color.SlateGray;
124 | // this.rjRadioButton24.Location = new System.Drawing.Point(56, 220);
125 | // this.rjRadioButton24.MinimumSize = new System.Drawing.Size(0, 21);
126 | // this.rjRadioButton24.Name = "rjRadioButton24";
127 | // this.rjRadioButton24.Padding = new System.Windows.Forms.Padding(30, 0, 0, 0);
128 | // this.rjRadioButton24.Size = new System.Drawing.Size(169, 35);
129 | // this.rjRadioButton24.TabIndex = 27;
130 | // this.rjRadioButton24.TabStop = true;
131 | // this.rjRadioButton24.Text = "Option C";
132 | // this.rjRadioButton24.UnCheckedColor = System.Drawing.Color.SlateGray;
133 | // this.rjRadioButton24.UseVisualStyleBackColor = true;
134 | // //
135 | // // rjRadioButton25
136 | // //
137 | // this.rjRadioButton25.AutoSize = true;
138 | // this.rjRadioButton25.CheckedColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
139 | // this.rjRadioButton25.Cursor = System.Windows.Forms.Cursors.Hand;
140 | // this.rjRadioButton25.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F);
141 | // this.rjRadioButton25.ForeColor = System.Drawing.Color.DarkSlateBlue;
142 | // this.rjRadioButton25.Location = new System.Drawing.Point(56, 347);
143 | // this.rjRadioButton25.MinimumSize = new System.Drawing.Size(0, 21);
144 | // this.rjRadioButton25.Name = "rjRadioButton25";
145 | // this.rjRadioButton25.Padding = new System.Windows.Forms.Padding(30, 0, 0, 0);
146 | // this.rjRadioButton25.Size = new System.Drawing.Size(919, 97);
147 | // this.rjRadioButton25.TabIndex = 29;
148 | // this.rjRadioButton25.TabStop = true;
149 | // this.rjRadioButton25.Text = "A set of well-defined, ordered and finite instructions or rules that allow\r\nan ac" +
150 | //"tivity to be carried out in successive steps that do not raise doubts\r\nabout who" +
151 | //" should carry out said activity.";
152 | // this.rjRadioButton25.UnCheckedColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(151)))), ((int)(((byte)(109)))));
153 | // this.rjRadioButton25.UseVisualStyleBackColor = true;
154 | // //
155 | // // FormRadioButton
156 | // //
157 | // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
158 | // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
159 | // this.BackColor = System.Drawing.Color.WhiteSmoke;
160 | // this.ClientSize = new System.Drawing.Size(984, 511);
161 | // this.Controls.Add(this.rjRadioButton25);
162 | // this.Controls.Add(this.rjRadioButton23);
163 | // this.Controls.Add(this.rjRadioButton24);
164 | // this.Controls.Add(this.rjRadioButton22);
165 | // this.Controls.Add(this.rjRadioButton21);
166 | this.Controls.Add(this.panel1);
167 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
168 | this.Name = "FormRadioButton";
169 | this.Text = "Custom Controls";
170 | this.panel1.ResumeLayout(false);
171 | this.panel1.PerformLayout();
172 | this.ResumeLayout(false);
173 | this.PerformLayout();
174 |
175 | }
176 |
177 | #endregion
178 |
179 | private System.Windows.Forms.Label label1;
180 | private System.Windows.Forms.Panel panel1;
181 | private RJControls.RJRadioButton rjRadioButton21;
182 | private RJControls.RJRadioButton rjRadioButton22;
183 | private RJControls.RJRadioButton rjRadioButton23;
184 | private RJControls.RJRadioButton rjRadioButton24;
185 | private RJControls.RJRadioButton rjRadioButton25;
186 | }
187 | }
--------------------------------------------------------------------------------
/CustomControls/Forms/FormRadioButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace CustomControls.Testing
12 | {
13 | public partial class FormRadioButton : Form
14 | {
15 | public FormRadioButton()
16 | {
17 | InitializeComponent();
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/CustomControls/Forms/FormTextBox.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace CustomControls
2 | {
3 | partial class FormTextBox
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormTextBox));
32 | this.panel1 = new System.Windows.Forms.Panel();
33 | this.label1 = new System.Windows.Forms.Label();
34 | this.label9 = new System.Windows.Forms.Label();
35 | this.label10 = new System.Windows.Forms.Label();
36 | this.label11 = new System.Windows.Forms.Label();
37 | this.rjTextBox8 = new CustomControls.RJControls.RJTextBox();
38 | this.rjTextBox9 = new CustomControls.RJControls.RJTextBox();
39 | this.rjTextBox10 = new CustomControls.RJControls.RJTextBox();
40 | this.rjTextBox6 = new CustomControls.RJControls.RJTextBox();
41 | this.rjTextBox7 = new CustomControls.RJControls.RJTextBox();
42 | this.rjTextBox1 = new CustomControls.RJControls.RJTextBox();
43 | this.rjTextBox2 = new CustomControls.RJControls.RJTextBox();
44 | this.rjTextBox3 = new CustomControls.RJControls.RJTextBox();
45 | this.rjTextBox5 = new CustomControls.RJControls.RJTextBox();
46 | this.panel1.SuspendLayout();
47 | this.SuspendLayout();
48 | //
49 | // panel1
50 | //
51 | this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(194)))), ((int)(((byte)(57)))), ((int)(((byte)(179)))));
52 | this.panel1.Controls.Add(this.label1);
53 | this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
54 | this.panel1.Location = new System.Drawing.Point(0, 0);
55 | this.panel1.Name = "panel1";
56 | this.panel1.Size = new System.Drawing.Size(866, 50);
57 | this.panel1.TabIndex = 11;
58 | //
59 | // label1
60 | //
61 | this.label1.AutoSize = true;
62 | this.label1.Font = new System.Drawing.Font("Montserrat Medium", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
63 | this.label1.ForeColor = System.Drawing.Color.White;
64 | this.label1.Location = new System.Drawing.Point(19, 7);
65 | this.label1.Name = "label1";
66 | this.label1.Size = new System.Drawing.Size(832, 37);
67 | this.label1.TabIndex = 0;
68 | this.label1.Text = "Custom TextBox (Rounded + Placeholder)- C# WinForm";
69 | //
70 | // label9
71 | //
72 | this.label9.AutoSize = true;
73 | this.label9.Font = new System.Drawing.Font("Verdana", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
74 | this.label9.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
75 | this.label9.Location = new System.Drawing.Point(65, 270);
76 | this.label9.Name = "label9";
77 | this.label9.Size = new System.Drawing.Size(77, 25);
78 | this.label9.TabIndex = 21;
79 | this.label9.Text = "Stock:";
80 | //
81 | // label10
82 | //
83 | this.label10.AutoSize = true;
84 | this.label10.Font = new System.Drawing.Font("Verdana", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
85 | this.label10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
86 | this.label10.Location = new System.Drawing.Point(8, 320);
87 | this.label10.Name = "label10";
88 | this.label10.Size = new System.Drawing.Size(134, 25);
89 | this.label10.TabIndex = 19;
90 | this.label10.Text = "Description:";
91 | //
92 | // label11
93 | //
94 | this.label11.AutoSize = true;
95 | this.label11.Font = new System.Drawing.Font("Verdana", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
96 | this.label11.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
97 | this.label11.Location = new System.Drawing.Point(45, 217);
98 | this.label11.Name = "label11";
99 | this.label11.Size = new System.Drawing.Size(97, 25);
100 | this.label11.TabIndex = 17;
101 | this.label11.Text = "Product:";
102 | //
103 | // rjTextBox8
104 | //
105 | this.rjTextBox8.BackColor = System.Drawing.Color.White;
106 | this.rjTextBox8.BorderColor = System.Drawing.Color.Magenta;
107 | this.rjTextBox8.BorderFocusColor = System.Drawing.Color.MediumSeaGreen;
108 | this.rjTextBox8.BorderRadius = 12;
109 | this.rjTextBox8.BorderSize = 3;
110 | this.rjTextBox8.Font = new System.Drawing.Font("Verdana", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
111 | this.rjTextBox8.ForeColor = System.Drawing.Color.Gray;
112 | this.rjTextBox8.Location = new System.Drawing.Point(149, 263);
113 | this.rjTextBox8.Margin = new System.Windows.Forms.Padding(4);
114 | this.rjTextBox8.Multiline = false;
115 | this.rjTextBox8.Name = "rjTextBox8";
116 | this.rjTextBox8.Padding = new System.Windows.Forms.Padding(7);
117 | this.rjTextBox8.PasswordChar = false;
118 | this.rjTextBox8.PlaceholderColor = System.Drawing.Color.DarkGray;
119 | this.rjTextBox8.PlaceholderText = "";
120 | this.rjTextBox8.Size = new System.Drawing.Size(331, 40);
121 | this.rjTextBox8.TabIndex = 20;
122 | this.rjTextBox8.Texts = "";
123 | this.rjTextBox8.UnderlinedStyle = false;
124 | //
125 | // rjTextBox9
126 | //
127 | this.rjTextBox9.BackColor = System.Drawing.Color.Lavender;
128 | this.rjTextBox9.BorderColor = System.Drawing.Color.CornflowerBlue;
129 | this.rjTextBox9.BorderFocusColor = System.Drawing.Color.MediumSeaGreen;
130 | this.rjTextBox9.BorderRadius = 30;
131 | this.rjTextBox9.BorderSize = 4;
132 | this.rjTextBox9.Font = new System.Drawing.Font("Verdana", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
133 | this.rjTextBox9.ForeColor = System.Drawing.Color.Gray;
134 | this.rjTextBox9.Location = new System.Drawing.Point(149, 317);
135 | this.rjTextBox9.Margin = new System.Windows.Forms.Padding(4);
136 | this.rjTextBox9.Multiline = true;
137 | this.rjTextBox9.Name = "rjTextBox9";
138 | this.rjTextBox9.Padding = new System.Windows.Forms.Padding(7);
139 | this.rjTextBox9.PasswordChar = false;
140 | this.rjTextBox9.PlaceholderColor = System.Drawing.Color.DarkGray;
141 | this.rjTextBox9.PlaceholderText = " Multiline + Border radius";
142 | this.rjTextBox9.Size = new System.Drawing.Size(683, 172);
143 | this.rjTextBox9.TabIndex = 18;
144 | this.rjTextBox9.Texts = "";
145 | this.rjTextBox9.UnderlinedStyle = false;
146 | //
147 | // rjTextBox10
148 | //
149 | this.rjTextBox10.BackColor = System.Drawing.Color.White;
150 | this.rjTextBox10.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
151 | this.rjTextBox10.BorderFocusColor = System.Drawing.Color.HotPink;
152 | this.rjTextBox10.BorderRadius = 12;
153 | this.rjTextBox10.BorderSize = 2;
154 | this.rjTextBox10.Font = new System.Drawing.Font("Verdana", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
155 | this.rjTextBox10.ForeColor = System.Drawing.Color.Gray;
156 | this.rjTextBox10.Location = new System.Drawing.Point(149, 208);
157 | this.rjTextBox10.Margin = new System.Windows.Forms.Padding(4);
158 | this.rjTextBox10.Multiline = false;
159 | this.rjTextBox10.Name = "rjTextBox10";
160 | this.rjTextBox10.Padding = new System.Windows.Forms.Padding(7);
161 | this.rjTextBox10.PasswordChar = false;
162 | this.rjTextBox10.PlaceholderColor = System.Drawing.Color.DarkGray;
163 | this.rjTextBox10.PlaceholderText = "";
164 | this.rjTextBox10.Size = new System.Drawing.Size(331, 40);
165 | this.rjTextBox10.TabIndex = 16;
166 | this.rjTextBox10.Texts = "";
167 | this.rjTextBox10.UnderlinedStyle = false;
168 | //
169 | // rjTextBox6
170 | //
171 | this.rjTextBox6.BackColor = System.Drawing.Color.WhiteSmoke;
172 | this.rjTextBox6.BorderColor = System.Drawing.Color.DeepPink;
173 | this.rjTextBox6.BorderFocusColor = System.Drawing.Color.RoyalBlue;
174 | this.rjTextBox6.BorderRadius = 0;
175 | this.rjTextBox6.BorderSize = 2;
176 | this.rjTextBox6.Font = new System.Drawing.Font("Verdana", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
177 | this.rjTextBox6.ForeColor = System.Drawing.Color.HotPink;
178 | this.rjTextBox6.Location = new System.Drawing.Point(70, 112);
179 | this.rjTextBox6.Margin = new System.Windows.Forms.Padding(4);
180 | this.rjTextBox6.Multiline = false;
181 | this.rjTextBox6.Name = "rjTextBox6";
182 | this.rjTextBox6.Padding = new System.Windows.Forms.Padding(7);
183 | this.rjTextBox6.PasswordChar = true;
184 | this.rjTextBox6.PlaceholderColor = System.Drawing.Color.DarkGray;
185 | this.rjTextBox6.PlaceholderText = "Passoword";
186 | this.rjTextBox6.Size = new System.Drawing.Size(250, 40);
187 | this.rjTextBox6.TabIndex = 14;
188 | this.rjTextBox6.Texts = "";
189 | this.rjTextBox6.UnderlinedStyle = true;
190 | //
191 | // rjTextBox7
192 | //
193 | this.rjTextBox7.BackColor = System.Drawing.Color.WhiteSmoke;
194 | this.rjTextBox7.BorderColor = System.Drawing.Color.DeepPink;
195 | this.rjTextBox7.BorderFocusColor = System.Drawing.Color.RoyalBlue;
196 | this.rjTextBox7.BorderRadius = 0;
197 | this.rjTextBox7.BorderSize = 2;
198 | this.rjTextBox7.Font = new System.Drawing.Font("Verdana", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
199 | this.rjTextBox7.ForeColor = System.Drawing.Color.HotPink;
200 | this.rjTextBox7.Location = new System.Drawing.Point(70, 68);
201 | this.rjTextBox7.Margin = new System.Windows.Forms.Padding(4);
202 | this.rjTextBox7.Multiline = false;
203 | this.rjTextBox7.Name = "rjTextBox7";
204 | this.rjTextBox7.Padding = new System.Windows.Forms.Padding(7);
205 | this.rjTextBox7.PasswordChar = false;
206 | this.rjTextBox7.PlaceholderColor = System.Drawing.Color.DarkGray;
207 | this.rjTextBox7.PlaceholderText = "Username";
208 | this.rjTextBox7.Size = new System.Drawing.Size(250, 40);
209 | this.rjTextBox7.TabIndex = 12;
210 | this.rjTextBox7.Texts = "";
211 | this.rjTextBox7.UnderlinedStyle = true;
212 | //
213 | // rjTextBox1
214 | //
215 | this.rjTextBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
216 | this.rjTextBox1.BorderColor = System.Drawing.Color.Black;
217 | this.rjTextBox1.BorderFocusColor = System.Drawing.Color.Crimson;
218 | this.rjTextBox1.BorderRadius = 20;
219 | this.rjTextBox1.BorderSize = 3;
220 | this.rjTextBox1.Font = new System.Drawing.Font("Verdana", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
221 | this.rjTextBox1.ForeColor = System.Drawing.Color.Black;
222 | this.rjTextBox1.Location = new System.Drawing.Point(371, 112);
223 | this.rjTextBox1.Margin = new System.Windows.Forms.Padding(4);
224 | this.rjTextBox1.Multiline = false;
225 | this.rjTextBox1.Name = "rjTextBox1";
226 | this.rjTextBox1.Padding = new System.Windows.Forms.Padding(7);
227 | this.rjTextBox1.PasswordChar = true;
228 | this.rjTextBox1.PlaceholderColor = System.Drawing.Color.Gray;
229 | this.rjTextBox1.PlaceholderText = " Address";
230 | this.rjTextBox1.Size = new System.Drawing.Size(289, 40);
231 | this.rjTextBox1.TabIndex = 24;
232 | this.rjTextBox1.Texts = "";
233 | this.rjTextBox1.UnderlinedStyle = true;
234 | //
235 | // rjTextBox2
236 | //
237 | this.rjTextBox2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
238 | this.rjTextBox2.BorderColor = System.Drawing.Color.Black;
239 | this.rjTextBox2.BorderFocusColor = System.Drawing.Color.Crimson;
240 | this.rjTextBox2.BorderRadius = 20;
241 | this.rjTextBox2.BorderSize = 3;
242 | this.rjTextBox2.Font = new System.Drawing.Font("Verdana", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
243 | this.rjTextBox2.ForeColor = System.Drawing.Color.Black;
244 | this.rjTextBox2.Location = new System.Drawing.Point(371, 68);
245 | this.rjTextBox2.Margin = new System.Windows.Forms.Padding(4);
246 | this.rjTextBox2.Multiline = false;
247 | this.rjTextBox2.Name = "rjTextBox2";
248 | this.rjTextBox2.Padding = new System.Windows.Forms.Padding(7);
249 | this.rjTextBox2.PasswordChar = false;
250 | this.rjTextBox2.PlaceholderColor = System.Drawing.Color.Gray;
251 | this.rjTextBox2.PlaceholderText = " Email";
252 | this.rjTextBox2.Size = new System.Drawing.Size(289, 40);
253 | this.rjTextBox2.TabIndex = 22;
254 | this.rjTextBox2.Texts = "";
255 | this.rjTextBox2.UnderlinedStyle = true;
256 | //
257 | // rjTextBox3
258 | //
259 | this.rjTextBox3.BackColor = System.Drawing.Color.White;
260 | this.rjTextBox3.BorderColor = System.Drawing.Color.RoyalBlue;
261 | this.rjTextBox3.BorderFocusColor = System.Drawing.Color.MediumSlateBlue;
262 | this.rjTextBox3.BorderRadius = 20;
263 | this.rjTextBox3.BorderSize = 2;
264 | this.rjTextBox3.Font = new System.Drawing.Font("Verdana", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
265 | this.rjTextBox3.ForeColor = System.Drawing.Color.Gray;
266 | this.rjTextBox3.Location = new System.Drawing.Point(501, 263);
267 | this.rjTextBox3.Margin = new System.Windows.Forms.Padding(4);
268 | this.rjTextBox3.Multiline = false;
269 | this.rjTextBox3.Name = "rjTextBox3";
270 | this.rjTextBox3.Padding = new System.Windows.Forms.Padding(7);
271 | this.rjTextBox3.PasswordChar = false;
272 | this.rjTextBox3.PlaceholderColor = System.Drawing.Color.DarkGray;
273 | this.rjTextBox3.PlaceholderText = " Price";
274 | this.rjTextBox3.Size = new System.Drawing.Size(331, 40);
275 | this.rjTextBox3.TabIndex = 27;
276 | this.rjTextBox3.Texts = "";
277 | this.rjTextBox3.UnderlinedStyle = false;
278 | //
279 | // rjTextBox5
280 | //
281 | this.rjTextBox5.BackColor = System.Drawing.Color.White;
282 | this.rjTextBox5.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
283 | this.rjTextBox5.BorderFocusColor = System.Drawing.Color.HotPink;
284 | this.rjTextBox5.BorderRadius = 20;
285 | this.rjTextBox5.BorderSize = 2;
286 | this.rjTextBox5.Font = new System.Drawing.Font("Verdana", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
287 | this.rjTextBox5.ForeColor = System.Drawing.Color.Gray;
288 | this.rjTextBox5.Location = new System.Drawing.Point(501, 208);
289 | this.rjTextBox5.Margin = new System.Windows.Forms.Padding(4);
290 | this.rjTextBox5.Multiline = false;
291 | this.rjTextBox5.Name = "rjTextBox5";
292 | this.rjTextBox5.Padding = new System.Windows.Forms.Padding(7);
293 | this.rjTextBox5.PasswordChar = false;
294 | this.rjTextBox5.PlaceholderColor = System.Drawing.Color.DarkGray;
295 | this.rjTextBox5.PlaceholderText = " Category";
296 | this.rjTextBox5.Size = new System.Drawing.Size(331, 40);
297 | this.rjTextBox5.TabIndex = 25;
298 | this.rjTextBox5.Texts = "";
299 | this.rjTextBox5.UnderlinedStyle = false;
300 | //
301 | // FormTextBox
302 | //
303 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
304 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
305 | this.BackColor = System.Drawing.Color.WhiteSmoke;
306 | this.ClientSize = new System.Drawing.Size(866, 511);
307 | this.Controls.Add(this.rjTextBox3);
308 | this.Controls.Add(this.rjTextBox5);
309 | this.Controls.Add(this.rjTextBox1);
310 | this.Controls.Add(this.rjTextBox2);
311 | this.Controls.Add(this.label9);
312 | this.Controls.Add(this.rjTextBox8);
313 | this.Controls.Add(this.label10);
314 | this.Controls.Add(this.rjTextBox9);
315 | this.Controls.Add(this.label11);
316 | this.Controls.Add(this.rjTextBox10);
317 | this.Controls.Add(this.rjTextBox6);
318 | this.Controls.Add(this.rjTextBox7);
319 | this.Controls.Add(this.panel1);
320 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
321 | this.Name = "FormTextBox";
322 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
323 | this.Text = "Custom Controls";
324 | this.panel1.ResumeLayout(false);
325 | this.panel1.PerformLayout();
326 | this.ResumeLayout(false);
327 | this.PerformLayout();
328 |
329 | }
330 |
331 | #endregion
332 | private System.Windows.Forms.Panel panel1;
333 | private System.Windows.Forms.Label label1;
334 | private RJControls.RJTextBox rjTextBox6;
335 | private RJControls.RJTextBox rjTextBox7;
336 | private System.Windows.Forms.Label label9;
337 | private RJControls.RJTextBox rjTextBox8;
338 | private System.Windows.Forms.Label label10;
339 | private RJControls.RJTextBox rjTextBox9;
340 | private System.Windows.Forms.Label label11;
341 | private RJControls.RJTextBox rjTextBox10;
342 | private RJControls.RJTextBox rjTextBox1;
343 | private RJControls.RJTextBox rjTextBox2;
344 | private RJControls.RJTextBox rjTextBox3;
345 | private RJControls.RJTextBox rjTextBox5;
346 | }
347 | }
348 |
349 |
--------------------------------------------------------------------------------
/CustomControls/Forms/FormTextBox.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace CustomControls
12 | {
13 | public partial class FormTextBox : Form
14 | {
15 | public FormTextBox()
16 | {
17 | InitializeComponent();
18 | label1.Select();
19 | }
20 |
21 | private void textBox1_TextChanged(object sender, EventArgs e)
22 | {
23 | //TextChanged
24 | }
25 |
26 | private void rjTextBox1_Load(object sender, EventArgs e)
27 | {
28 |
29 | }
30 |
31 | private void rjTextBox7__TextChanged(object sender, EventArgs e)
32 | {
33 | MessageBox.Show("Text Changed");
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/CustomControls/Forms/FormToggleButton.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace CustomControls.Testing
2 | {
3 | partial class FormToggleButton
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormToggleButton));
32 | this.panel1 = new System.Windows.Forms.Panel();
33 | this.label1 = new System.Windows.Forms.Label();
34 | this.label2 = new System.Windows.Forms.Label();
35 | this.label3 = new System.Windows.Forms.Label();
36 | this.label4 = new System.Windows.Forms.Label();
37 | this.label5 = new System.Windows.Forms.Label();
38 | this.label6 = new System.Windows.Forms.Label();
39 | this.label7 = new System.Windows.Forms.Label();
40 | this.label8 = new System.Windows.Forms.Label();
41 | this.label9 = new System.Windows.Forms.Label();
42 | this.label10 = new System.Windows.Forms.Label();
43 | this.label11 = new System.Windows.Forms.Label();
44 | this.rjToggleButton4 = new CustomControls.RJControls.RJToggleButton();
45 | this.rjToggleButton5 = new CustomControls.RJControls.RJToggleButton();
46 | this.rjToggleButton6 = new CustomControls.RJControls.RJToggleButton();
47 | this.rjToggleButton3 = new CustomControls.RJControls.RJToggleButton();
48 | this.rjToggleButton2 = new CustomControls.RJControls.RJToggleButton();
49 | this.rjToggleButton1 = new CustomControls.RJControls.RJToggleButton();
50 | this.panel1.SuspendLayout();
51 | this.SuspendLayout();
52 | //
53 | // panel1
54 | //
55 | this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(153)))), ((int)(((byte)(188)))));
56 | this.panel1.Controls.Add(this.label1);
57 | this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
58 | this.panel1.Location = new System.Drawing.Point(0, 0);
59 | this.panel1.Name = "panel1";
60 | this.panel1.Size = new System.Drawing.Size(984, 50);
61 | this.panel1.TabIndex = 25;
62 | //
63 | // label1
64 | //
65 | this.label1.AutoSize = true;
66 | this.label1.Font = new System.Drawing.Font("Montserrat", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
67 | this.label1.ForeColor = System.Drawing.Color.White;
68 | this.label1.Location = new System.Drawing.Point(330, 13);
69 | this.label1.Name = "label1";
70 | this.label1.Size = new System.Drawing.Size(293, 24);
71 | this.label1.TabIndex = 0;
72 | this.label1.Text = "ToggleButton - C# WinForm";
73 | //
74 | // label2
75 | //
76 | this.label2.AutoSize = true;
77 | this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
78 | this.label2.ForeColor = System.Drawing.Color.Gray;
79 | this.label2.Location = new System.Drawing.Point(29, 153);
80 | this.label2.Name = "label2";
81 | this.label2.Size = new System.Drawing.Size(154, 31);
82 | this.label2.TabIndex = 27;
83 | this.label2.Text = "Dark theme";
84 | //
85 | // label3
86 | //
87 | this.label3.AutoSize = true;
88 | this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
89 | this.label3.ForeColor = System.Drawing.Color.RoyalBlue;
90 | this.label3.Location = new System.Drawing.Point(126, 80);
91 | this.label3.Name = "label3";
92 | this.label3.Size = new System.Drawing.Size(162, 31);
93 | this.label3.TabIndex = 29;
94 | this.label3.Text = "FILL STYLE";
95 | //
96 | // label4
97 | //
98 | this.label4.AutoSize = true;
99 | this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
100 | this.label4.ForeColor = System.Drawing.Color.Gray;
101 | this.label4.Location = new System.Drawing.Point(29, 259);
102 | this.label4.Name = "label4";
103 | this.label4.Size = new System.Drawing.Size(191, 31);
104 | this.label4.TabIndex = 30;
105 | this.label4.Text = "Remember me";
106 | //
107 | // label5
108 | //
109 | this.label5.AutoSize = true;
110 | this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
111 | this.label5.ForeColor = System.Drawing.Color.Gray;
112 | this.label5.Location = new System.Drawing.Point(128, 370);
113 | this.label5.Name = "label5";
114 | this.label5.Size = new System.Drawing.Size(55, 31);
115 | this.label5.TabIndex = 32;
116 | this.label5.Text = "ON";
117 | //
118 | // label6
119 | //
120 | this.label6.AutoSize = true;
121 | this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
122 | this.label6.ForeColor = System.Drawing.Color.Gray;
123 | this.label6.Location = new System.Drawing.Point(395, 370);
124 | this.label6.Name = "label6";
125 | this.label6.Size = new System.Drawing.Size(69, 31);
126 | this.label6.TabIndex = 33;
127 | this.label6.Text = "OFF";
128 | //
129 | // label7
130 | //
131 | this.label7.AutoSize = true;
132 | this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
133 | this.label7.ForeColor = System.Drawing.Color.Gray;
134 | this.label7.Location = new System.Drawing.Point(887, 370);
135 | this.label7.Name = "label7";
136 | this.label7.Size = new System.Drawing.Size(69, 31);
137 | this.label7.TabIndex = 41;
138 | this.label7.Text = "OFF";
139 | //
140 | // label8
141 | //
142 | this.label8.AutoSize = true;
143 | this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
144 | this.label8.ForeColor = System.Drawing.Color.Gray;
145 | this.label8.Location = new System.Drawing.Point(620, 370);
146 | this.label8.Name = "label8";
147 | this.label8.Size = new System.Drawing.Size(55, 31);
148 | this.label8.TabIndex = 40;
149 | this.label8.Text = "ON";
150 | //
151 | // label9
152 | //
153 | this.label9.AutoSize = true;
154 | this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
155 | this.label9.ForeColor = System.Drawing.Color.Gray;
156 | this.label9.Location = new System.Drawing.Point(521, 259);
157 | this.label9.Name = "label9";
158 | this.label9.Size = new System.Drawing.Size(191, 31);
159 | this.label9.TabIndex = 38;
160 | this.label9.Text = "Remember me";
161 | //
162 | // label10
163 | //
164 | this.label10.AutoSize = true;
165 | this.label10.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
166 | this.label10.ForeColor = System.Drawing.Color.RoyalBlue;
167 | this.label10.Location = new System.Drawing.Point(618, 80);
168 | this.label10.Name = "label10";
169 | this.label10.Size = new System.Drawing.Size(224, 31);
170 | this.label10.TabIndex = 37;
171 | this.label10.Text = "BORDER STYLE";
172 | //
173 | // label11
174 | //
175 | this.label11.AutoSize = true;
176 | this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
177 | this.label11.ForeColor = System.Drawing.Color.Gray;
178 | this.label11.Location = new System.Drawing.Point(521, 153);
179 | this.label11.Name = "label11";
180 | this.label11.Size = new System.Drawing.Size(154, 31);
181 | this.label11.TabIndex = 35;
182 | this.label11.Text = "Dark theme";
183 | //
184 | // rjToggleButton4
185 | //
186 | this.rjToggleButton4.Location = new System.Drawing.Point(681, 356);
187 | this.rjToggleButton4.MinimumSize = new System.Drawing.Size(45, 22);
188 | this.rjToggleButton4.Name = "rjToggleButton4";
189 | this.rjToggleButton4.OffBackColor = System.Drawing.Color.LightSteelBlue;
190 | this.rjToggleButton4.OffToggleColor = System.Drawing.Color.LightSteelBlue;
191 | this.rjToggleButton4.OnBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(94)))), ((int)(((byte)(71)))));
192 | this.rjToggleButton4.OnToggleColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(89)))), ((int)(((byte)(130)))));
193 | this.rjToggleButton4.Size = new System.Drawing.Size(200, 60);
194 | this.rjToggleButton4.SolidStyle = false;
195 | this.rjToggleButton4.TabIndex = 39;
196 | this.rjToggleButton4.UseVisualStyleBackColor = true;
197 | //
198 | // rjToggleButton5
199 | //
200 | this.rjToggleButton5.Checked = true;
201 | this.rjToggleButton5.CheckState = System.Windows.Forms.CheckState.Checked;
202 | this.rjToggleButton5.Location = new System.Drawing.Point(718, 251);
203 | this.rjToggleButton5.MinimumSize = new System.Drawing.Size(45, 22);
204 | this.rjToggleButton5.Name = "rjToggleButton5";
205 | this.rjToggleButton5.OffBackColor = System.Drawing.Color.LightCoral;
206 | this.rjToggleButton5.OffToggleColor = System.Drawing.Color.SlateGray;
207 | this.rjToggleButton5.OnBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(104)))), ((int)(((byte)(0)))), ((int)(((byte)(255)))));
208 | this.rjToggleButton5.OnToggleColor = System.Drawing.Color.Fuchsia;
209 | this.rjToggleButton5.Size = new System.Drawing.Size(200, 60);
210 | this.rjToggleButton5.SolidStyle = false;
211 | this.rjToggleButton5.TabIndex = 36;
212 | this.rjToggleButton5.UseVisualStyleBackColor = true;
213 | //
214 | // rjToggleButton6
215 | //
216 | this.rjToggleButton6.Checked = true;
217 | this.rjToggleButton6.CheckState = System.Windows.Forms.CheckState.Checked;
218 | this.rjToggleButton6.Location = new System.Drawing.Point(681, 145);
219 | this.rjToggleButton6.MinimumSize = new System.Drawing.Size(45, 22);
220 | this.rjToggleButton6.Name = "rjToggleButton6";
221 | this.rjToggleButton6.OffBackColor = System.Drawing.Color.DarkGray;
222 | this.rjToggleButton6.OffToggleColor = System.Drawing.Color.Silver;
223 | this.rjToggleButton6.OnBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(128)))), ((int)(((byte)(244)))));
224 | this.rjToggleButton6.OnToggleColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(128)))), ((int)(((byte)(244)))));
225 | this.rjToggleButton6.Size = new System.Drawing.Size(200, 60);
226 | this.rjToggleButton6.SolidStyle = false;
227 | this.rjToggleButton6.TabIndex = 34;
228 | this.rjToggleButton6.UseVisualStyleBackColor = true;
229 | this.rjToggleButton6.CheckedChanged += new System.EventHandler(this.rjToggleButton6_CheckedChanged);
230 | //
231 | // rjToggleButton3
232 | //
233 | this.rjToggleButton3.Checked = true;
234 | this.rjToggleButton3.CheckState = System.Windows.Forms.CheckState.Checked;
235 | this.rjToggleButton3.Location = new System.Drawing.Point(189, 356);
236 | this.rjToggleButton3.MinimumSize = new System.Drawing.Size(45, 22);
237 | this.rjToggleButton3.Name = "rjToggleButton3";
238 | this.rjToggleButton3.OffBackColor = System.Drawing.Color.LightSteelBlue;
239 | this.rjToggleButton3.OffToggleColor = System.Drawing.Color.White;
240 | this.rjToggleButton3.OnBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(26)))), ((int)(((byte)(240)))));
241 | this.rjToggleButton3.OnToggleColor = System.Drawing.Color.Black;
242 | this.rjToggleButton3.Size = new System.Drawing.Size(200, 60);
243 | this.rjToggleButton3.TabIndex = 31;
244 | this.rjToggleButton3.UseVisualStyleBackColor = true;
245 | //
246 | // rjToggleButton2
247 | //
248 | this.rjToggleButton2.Checked = true;
249 | this.rjToggleButton2.CheckState = System.Windows.Forms.CheckState.Checked;
250 | this.rjToggleButton2.Location = new System.Drawing.Point(226, 251);
251 | this.rjToggleButton2.MinimumSize = new System.Drawing.Size(45, 22);
252 | this.rjToggleButton2.Name = "rjToggleButton2";
253 | this.rjToggleButton2.OffBackColor = System.Drawing.Color.LightSlateGray;
254 | this.rjToggleButton2.OffToggleColor = System.Drawing.Color.LightSteelBlue;
255 | this.rjToggleButton2.OnBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(104)))), ((int)(((byte)(0)))), ((int)(((byte)(255)))));
256 | this.rjToggleButton2.OnToggleColor = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(231)))), ((int)(((byte)(248)))));
257 | this.rjToggleButton2.Size = new System.Drawing.Size(200, 60);
258 | this.rjToggleButton2.TabIndex = 28;
259 | this.rjToggleButton2.UseVisualStyleBackColor = true;
260 | //
261 | // rjToggleButton1
262 | //
263 | this.rjToggleButton1.Location = new System.Drawing.Point(189, 145);
264 | this.rjToggleButton1.MinimumSize = new System.Drawing.Size(45, 22);
265 | this.rjToggleButton1.Name = "rjToggleButton1";
266 | this.rjToggleButton1.OffBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(170)))), ((int)(((byte)(175)))), ((int)(((byte)(182)))));
267 | this.rjToggleButton1.OffToggleColor = System.Drawing.Color.WhiteSmoke;
268 | this.rjToggleButton1.OnBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(128)))), ((int)(((byte)(244)))));
269 | this.rjToggleButton1.OnToggleColor = System.Drawing.Color.WhiteSmoke;
270 | this.rjToggleButton1.Size = new System.Drawing.Size(200, 60);
271 | this.rjToggleButton1.TabIndex = 26;
272 | this.rjToggleButton1.UseVisualStyleBackColor = true;
273 | this.rjToggleButton1.CheckedChanged += new System.EventHandler(this.rjToggleButton1_CheckedChanged);
274 | //
275 | // FormToggleButton
276 | //
277 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
278 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
279 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(250)))), ((int)(((byte)(253)))));
280 | this.ClientSize = new System.Drawing.Size(984, 511);
281 | this.Controls.Add(this.label7);
282 | this.Controls.Add(this.label8);
283 | this.Controls.Add(this.rjToggleButton4);
284 | this.Controls.Add(this.label9);
285 | this.Controls.Add(this.label10);
286 | this.Controls.Add(this.rjToggleButton5);
287 | this.Controls.Add(this.label11);
288 | this.Controls.Add(this.rjToggleButton6);
289 | this.Controls.Add(this.label6);
290 | this.Controls.Add(this.label5);
291 | this.Controls.Add(this.rjToggleButton3);
292 | this.Controls.Add(this.label4);
293 | this.Controls.Add(this.label3);
294 | this.Controls.Add(this.rjToggleButton2);
295 | this.Controls.Add(this.label2);
296 | this.Controls.Add(this.rjToggleButton1);
297 | this.Controls.Add(this.panel1);
298 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
299 | this.Name = "FormToggleButton";
300 | this.Text = "CUSTOM CONTROLS";
301 | this.panel1.ResumeLayout(false);
302 | this.panel1.PerformLayout();
303 | this.ResumeLayout(false);
304 | this.PerformLayout();
305 |
306 | }
307 |
308 | #endregion
309 | private System.Windows.Forms.Panel panel1;
310 | private System.Windows.Forms.Label label1;
311 | private RJControls.RJToggleButton rjToggleButton1;
312 | private System.Windows.Forms.Label label2;
313 | private RJControls.RJToggleButton rjToggleButton2;
314 | private System.Windows.Forms.Label label3;
315 | private System.Windows.Forms.Label label4;
316 | private System.Windows.Forms.Label label5;
317 | private RJControls.RJToggleButton rjToggleButton3;
318 | private System.Windows.Forms.Label label6;
319 | private System.Windows.Forms.Label label7;
320 | private System.Windows.Forms.Label label8;
321 | private RJControls.RJToggleButton rjToggleButton4;
322 | private System.Windows.Forms.Label label9;
323 | private System.Windows.Forms.Label label10;
324 | private RJControls.RJToggleButton rjToggleButton5;
325 | private System.Windows.Forms.Label label11;
326 | private RJControls.RJToggleButton rjToggleButton6;
327 | }
328 | }
--------------------------------------------------------------------------------
/CustomControls/Forms/FormToggleButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace CustomControls.Testing
12 | {
13 | public partial class FormToggleButton : Form
14 | {
15 | public FormToggleButton()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | private void rjToggleButton1_CheckedChanged(object sender, EventArgs e)
21 | {
22 | if (rjToggleButton1.Checked == true)
23 | {
24 | this.BackColor = Color.FromArgb(31, 28, 47);
25 | foreach (var item in this.Controls)
26 | {
27 | if (item is Label)
28 | {
29 | Label lbl = (Label)item;
30 | lbl.ForeColor = Color.FromArgb(170, 175, 182);
31 | }
32 |
33 | }
34 | }
35 | else
36 | {
37 | this.BackColor = Color.FromArgb(245, 250, 253);
38 | foreach (var item in this.Controls)
39 | {
40 | if (item is Label)
41 | {
42 | Label lbl = (Label)item;
43 | lbl.ForeColor = Color.Gray;
44 | }
45 |
46 | }
47 | }
48 | }
49 |
50 | private void rjToggleButton6_CheckedChanged(object sender, EventArgs e)
51 | {
52 | if (rjToggleButton6.Checked == true)
53 | {
54 | this.BackColor = Color.FromArgb(31, 28, 47);
55 | foreach (var item in this.Controls)
56 | {
57 | if (item is Label)
58 | {
59 | Label lbl = (Label)item;
60 | lbl.ForeColor = Color.FromArgb(170, 175, 182);
61 | }
62 |
63 | }
64 | }
65 | else
66 | {
67 | this.BackColor = Color.FromArgb(245, 250, 253);
68 | foreach (var item in this.Controls)
69 | {
70 | if (item is Label)
71 | {
72 | Label lbl = (Label)item;
73 | lbl.ForeColor = Color.Gray;
74 | }
75 |
76 | }
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/CustomControls/Program.cs:
--------------------------------------------------------------------------------
1 | using CustomControls.Testing;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using System.Windows.Forms;
7 |
8 | namespace CustomControls
9 | {
10 | static class Program
11 | {
12 | ///
13 | /// The main entry point for the application.
14 | ///
15 | [STAThread]
16 | static void Main()
17 | {
18 | Application.EnableVisualStyles();
19 | Application.SetCompatibleTextRenderingDefault(false);
20 | Application.Run(new Form1());
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/CustomControls/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("CustomControls")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("CustomControls")]
13 | [assembly: AssemblyCopyright("Copyright © 2021")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("602aa7a6-9a92-47e1-b800-2f78154ea050")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/CustomControls/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Este código fue generado por una herramienta.
4 | // Versión de runtime:4.0.30319.42000
5 | //
6 | // Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
7 | // se vuelve a generar el código.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace CustomControls.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// Clase de recurso fuertemente tipado, para buscar cadenas traducidas, etc.
17 | ///
18 | // StronglyTypedResourceBuilder generó automáticamente esta clase
19 | // a través de una herramienta como ResGen o Visual Studio.
20 | // Para agregar o quitar un miembro, edite el archivo .ResX y, a continuación, vuelva a ejecutar ResGen
21 | // con la opción /str o recompile su proyecto de VS.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Devuelve la instancia de ResourceManager almacenada en caché utilizada por esta clase.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CustomControls.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Reemplaza la propiedad CurrentUICulture del subproceso actual para todas las
51 | /// búsquedas de recursos mediante esta clase de recurso fuertemente tipado.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Busca un recurso adaptado de tipo System.Drawing.Bitmap.
65 | ///
66 | internal static System.Drawing.Bitmap calendarDark {
67 | get {
68 | object obj = ResourceManager.GetObject("calendarDark", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// Busca un recurso adaptado de tipo System.Drawing.Bitmap.
75 | ///
76 | internal static System.Drawing.Bitmap calendarWhite {
77 | get {
78 | object obj = ResourceManager.GetObject("calendarWhite", resourceCulture);
79 | return ((System.Drawing.Bitmap)(obj));
80 | }
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/CustomControls/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\calendarDark.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
125 | ..\Resources\calendarWhite.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
--------------------------------------------------------------------------------
/CustomControls/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Este código fue generado por una herramienta.
4 | // Versión de runtime:4.0.30319.42000
5 | //
6 | // Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
7 | // se vuelve a generar el código.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace CustomControls.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CustomControls/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CustomControls/RJControls/MenuColorTable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows.Forms;
7 | using System.Drawing;
8 |
9 | namespace CustomControls.RJControls
10 | {
11 | public class MenuColorTable : ProfessionalColorTable
12 | {
13 | //Fields
14 | private Color backColor;
15 | private Color leftColumnColor;
16 | private Color borderColor;
17 | private Color menuItemBorderColor;
18 | private Color menuItemSelectedColor;
19 |
20 | //Constructor
21 | public MenuColorTable(bool isMainMenu, Color primaryColor)
22 | {
23 | if (isMainMenu)
24 | {
25 | backColor = Color.FromArgb(37, 39, 60);
26 | leftColumnColor = Color.FromArgb(32, 33, 51);
27 | borderColor = Color.FromArgb(32, 33, 51);
28 | menuItemBorderColor = primaryColor;
29 | menuItemSelectedColor = primaryColor;
30 | }
31 | else
32 | {
33 | backColor = Color.White;
34 | leftColumnColor = Color.LightGray;
35 | borderColor = Color.LightGray;
36 | menuItemBorderColor = primaryColor;
37 | menuItemSelectedColor = primaryColor;
38 | }
39 | }
40 |
41 | //Overrides
42 | public override Color ToolStripDropDownBackground { get { return backColor; } }
43 | public override Color MenuBorder { get { return borderColor; } }
44 | public override Color MenuItemBorder { get { return menuItemBorderColor; } }
45 | public override Color MenuItemSelected { get { return menuItemSelectedColor; } }
46 | public override Color ImageMarginGradientBegin { get { return leftColumnColor; } }
47 | public override Color ImageMarginGradientMiddle { get { return leftColumnColor; } }
48 | public override Color ImageMarginGradientEnd { get { return leftColumnColor; } }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/CustomControls/RJControls/MenuRenderer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows.Forms;
7 | using System.Drawing;
8 | using System.Drawing.Drawing2D;
9 |
10 | namespace CustomControls.RJControls
11 | {
12 | public class MenuRenderer : ToolStripProfessionalRenderer
13 | {
14 | //Fields
15 | private Color primaryColor;
16 | private Color textColor;
17 | private int arrowThickness;
18 |
19 | //Constructor
20 | public MenuRenderer(bool isMainMenu, Color primaryColor, Color textColor)
21 | : base(new MenuColorTable(isMainMenu, primaryColor))
22 | {
23 | this.primaryColor = primaryColor;
24 | if (isMainMenu)
25 | {
26 | arrowThickness = 3;
27 | if (textColor == Color.Empty) //Set Default Color
28 | this.textColor = Color.Gainsboro;
29 | else//Set custom text color
30 | this.textColor = textColor;
31 | }
32 | else
33 | {
34 | arrowThickness = 2;
35 | if (textColor == Color.Empty) //Set Default Color
36 | this.textColor = Color.DimGray;
37 | else//Set custom text color
38 | this.textColor = textColor;
39 | }
40 | }
41 |
42 | //Overrides
43 | protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e)
44 | {
45 | base.OnRenderItemText(e);
46 | e.Item.ForeColor = e.Item.Selected ? Color.White : textColor;
47 | }
48 |
49 | protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
50 | {
51 | //Fields
52 | var graph = e.Graphics;
53 | var arrowSize = new Size(5, 12);
54 | var arrowColor = e.Item.Selected ? Color.White : primaryColor;
55 | var rect = new Rectangle(e.ArrowRectangle.Location.X, (e.ArrowRectangle.Height - arrowSize.Height) / 2,
56 | arrowSize.Width, arrowSize.Height);
57 | using (GraphicsPath path = new GraphicsPath())
58 | using (Pen pen = new Pen(arrowColor, arrowThickness))
59 | {
60 | //Drawing
61 | graph.SmoothingMode = SmoothingMode.AntiAlias;
62 | path.AddLine(rect.Left, rect.Top, rect.Right, rect.Top + rect.Height / 2);
63 | path.AddLine(rect.Right, rect.Top + rect.Height / 2, rect.Left, rect.Top + rect.Height);
64 | graph.DrawPath(pen, path);
65 | }
66 | }
67 |
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/CustomControls/RJControls/RJButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using System.Windows.Forms;
8 | using System.Drawing;
9 | using System.Drawing.Drawing2D;
10 | using System.ComponentModel;
11 |
12 | namespace CustomControls.RJControls
13 | {
14 | public class RJButton : Button
15 | {
16 | //Fields
17 | private int borderSize = 0;
18 | private int borderRadius = 0;
19 | private Color borderColor = Color.PaleVioletRed;
20 |
21 | //Properties
22 | [Category("RJ Code Advance")]
23 | public int BorderSize
24 | {
25 | get { return borderSize; }
26 | set
27 | {
28 | borderSize = value;
29 | this.Invalidate();
30 | }
31 | }
32 |
33 | [Category("RJ Code Advance")]
34 | public int BorderRadius
35 | {
36 | get { return borderRadius; }
37 | set
38 | {
39 | borderRadius = value;
40 | this.Invalidate();
41 | }
42 | }
43 |
44 | [Category("RJ Code Advance")]
45 | public Color BorderColor
46 | {
47 | get { return borderColor; }
48 | set
49 | {
50 | borderColor = value;
51 | this.Invalidate();
52 | }
53 | }
54 |
55 | [Category("RJ Code Advance")]
56 | public Color BackgroundColor
57 | {
58 | get { return this.BackColor; }
59 | set { this.BackColor = value; }
60 | }
61 |
62 | [Category("RJ Code Advance")]
63 | public Color TextColor
64 | {
65 | get { return this.ForeColor; }
66 | set { this.ForeColor = value; }
67 | }
68 |
69 | //Constructor
70 | public RJButton()
71 | {
72 | this.FlatStyle = FlatStyle.Flat;
73 | this.FlatAppearance.BorderSize = 0;
74 | this.Size = new Size(150, 40);
75 | this.BackColor = Color.MediumSlateBlue;
76 | this.ForeColor = Color.White;
77 | this.Resize += new EventHandler(Button_Resize);
78 | }
79 |
80 | //Methods
81 | private GraphicsPath GetFigurePath(Rectangle rect, int radius)
82 | {
83 | GraphicsPath path = new GraphicsPath();
84 | float curveSize = radius * 2F;
85 |
86 | path.StartFigure();
87 | path.AddArc(rect.X, rect.Y, curveSize, curveSize, 180, 90);
88 | path.AddArc(rect.Right - curveSize, rect.Y, curveSize, curveSize, 270, 90);
89 | path.AddArc(rect.Right - curveSize, rect.Bottom - curveSize, curveSize, curveSize, 0, 90);
90 | path.AddArc(rect.X, rect.Bottom - curveSize, curveSize, curveSize, 90, 90);
91 | path.CloseFigure();
92 | return path;
93 | }
94 |
95 | protected override void OnPaint(PaintEventArgs pevent)
96 | {
97 | base.OnPaint(pevent);
98 |
99 | Rectangle rectSurface = this.ClientRectangle;
100 | Rectangle rectBorder = Rectangle.Inflate(rectSurface, -borderSize, -borderSize);
101 | int smoothSize = 2;
102 | if (borderSize > 0)
103 | smoothSize = borderSize;
104 |
105 | if (borderRadius > 2) //Rounded button
106 | {
107 | using (GraphicsPath pathSurface = GetFigurePath(rectSurface, borderRadius))
108 | using (GraphicsPath pathBorder = GetFigurePath(rectBorder, borderRadius - borderSize))
109 | using (Pen penSurface = new Pen(this.Parent.BackColor, smoothSize))
110 | using (Pen penBorder = new Pen(borderColor, borderSize))
111 | {
112 | pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
113 | //Button surface
114 | this.Region = new Region(pathSurface);
115 | //Draw surface border for HD result
116 | pevent.Graphics.DrawPath(penSurface, pathSurface);
117 |
118 | //Button border
119 | if (borderSize >= 1)
120 | //Draw control border
121 | pevent.Graphics.DrawPath(penBorder, pathBorder);
122 | }
123 | }
124 | else //Normal button
125 | {
126 | pevent.Graphics.SmoothingMode = SmoothingMode.None;
127 | //Button surface
128 | this.Region = new Region(rectSurface);
129 | //Button border
130 | if (borderSize >= 1)
131 | {
132 | using (Pen penBorder = new Pen(borderColor, borderSize))
133 | {
134 | penBorder.Alignment = PenAlignment.Inset;
135 | pevent.Graphics.DrawRectangle(penBorder, 0, 0, this.Width - 1, this.Height - 1);
136 | }
137 | }
138 | }
139 | }
140 | protected override void OnHandleCreated(EventArgs e)
141 | {
142 | base.OnHandleCreated(e);
143 | this.Parent.BackColorChanged += new EventHandler(Container_BackColorChanged);
144 | }
145 | private void Container_BackColorChanged(object sender, EventArgs e)
146 | {
147 | this.Invalidate();
148 | }
149 | private void Button_Resize(object sender, EventArgs e)
150 | {
151 | if (borderRadius > this.Height)
152 | borderRadius = this.Height;
153 | }
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/CustomControls/RJControls/RJCircularPictureBox.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using System.Windows.Forms;
8 | using System.Drawing;
9 | using System.Drawing.Drawing2D;
10 | using System.ComponentModel;
11 |
12 | namespace CustomControls.RJControls
13 | {
14 | class RJCircularPictureBox : PictureBox
15 | {
16 | //Fields
17 | private int borderSize = 2;
18 | private Color borderColor = Color.RoyalBlue;
19 | private Color borderColor2 = Color.HotPink;
20 | private DashStyle borderLineStyle = DashStyle.Solid;
21 | private DashCap borderCapStyle = DashCap.Flat;
22 | private float gradientAngle = 50F;
23 |
24 | //Constructor
25 | public RJCircularPictureBox()
26 | {
27 | this.Size = new Size(100, 100);
28 | this.SizeMode = PictureBoxSizeMode.StretchImage;
29 | }
30 |
31 | //Properties
32 | [Category("RJ Code Advance")]
33 | public int BorderSize
34 | {
35 | get { return borderSize; }
36 | set
37 | {
38 | borderSize = value;
39 | this.Invalidate();
40 | }
41 | }
42 |
43 | [Category("RJ Code Advance")]
44 | public Color BorderColor
45 | {
46 | get { return borderColor; }
47 | set
48 | {
49 | borderColor = value;
50 | this.Invalidate();
51 | }
52 | }
53 |
54 | [Category("RJ Code Advance")]
55 | public Color BorderColor2
56 | {
57 | get { return borderColor2; }
58 | set
59 | {
60 | borderColor2 = value;
61 | this.Invalidate();
62 | }
63 | }
64 |
65 | [Category("RJ Code Advance")]
66 | public DashStyle BorderLineStyle
67 | {
68 | get { return borderLineStyle; }
69 | set
70 | {
71 | borderLineStyle = value;
72 | this.Invalidate();
73 | }
74 | }
75 |
76 | [Category("RJ Code Advance")]
77 | public DashCap BorderCapStyle
78 | {
79 | get { return borderCapStyle; }
80 | set
81 | {
82 | borderCapStyle = value;
83 | this.Invalidate();
84 | }
85 | }
86 |
87 | [Category("RJ Code Advance")]
88 | public float GradientAngle
89 | {
90 | get { return gradientAngle; }
91 | set
92 | {
93 | gradientAngle = value;
94 | this.Invalidate();
95 | }
96 | }
97 |
98 | //Overridden methods
99 | protected override void OnResize(EventArgs e)
100 | {
101 | base.OnResize(e);
102 | this.Size = new Size(this.Width, this.Width);
103 | }
104 |
105 | protected override void OnPaint(PaintEventArgs pe)
106 | {
107 | base.OnPaint(pe);
108 | //Fields
109 | var graph = pe.Graphics;
110 | var rectContourSmooth = Rectangle.Inflate(this.ClientRectangle, -1, -1);
111 | var rectBorder = Rectangle.Inflate(rectContourSmooth, -borderSize, -borderSize);
112 | var smoothSize = borderSize > 0 ? borderSize * 3 : 1;
113 | using (var borderGColor = new LinearGradientBrush(rectBorder, borderColor, borderColor2, gradientAngle))
114 | using (var pathRegion = new GraphicsPath())
115 | using (var penSmooth = new Pen(this.Parent.BackColor, smoothSize))
116 | using (var penBorder = new Pen(borderGColor, borderSize))
117 | {
118 | graph.SmoothingMode = SmoothingMode.AntiAlias;
119 | penBorder.DashStyle = borderLineStyle;
120 | penBorder.DashCap = borderCapStyle;
121 | pathRegion.AddEllipse(rectContourSmooth);
122 | //Set rounded region
123 | this.Region = new Region(pathRegion);
124 |
125 | //Drawing
126 | graph.DrawEllipse(penSmooth, rectContourSmooth);//Draw contour smoothing
127 | if (borderSize > 0) //Draw border
128 | graph.DrawEllipse(penBorder, rectBorder);
129 | }
130 | }
131 | }
132 | }
133 |
--------------------------------------------------------------------------------
/CustomControls/RJControls/RJComboBox.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using System.Windows.Forms;
8 | using System.Drawing;
9 | using System.Drawing.Drawing2D;
10 | using System.ComponentModel;
11 | using System.Drawing.Design;
12 |
13 | namespace CustomControls.RJControls
14 | {
15 | [DefaultEvent("OnSelectedIndexChanged")]
16 | class RJComboBox : UserControl
17 | {
18 | #region -> Fields
19 | //Fields
20 | private Color backColor = Color.WhiteSmoke;
21 | private Color iconColor = Color.MediumSlateBlue;
22 | private Color listBackColor = Color.FromArgb(230, 228, 245);
23 | private Color listTextColor = Color.DimGray;
24 | private Color borderColor = Color.MediumSlateBlue;
25 | private int borderSize = 1;
26 |
27 | //Items
28 | private ComboBox cmbList;
29 | private Label lblText;
30 | private Button btnIcon;
31 |
32 | //Events
33 | public event EventHandler OnSelectedIndexChanged;//Default event
34 | #endregion
35 |
36 | #region -> Constructor
37 | public RJComboBox()
38 | {
39 | cmbList = new ComboBox();
40 | lblText = new Label();
41 | btnIcon = new Button();
42 | this.SuspendLayout();
43 |
44 | //ComboBox: Dropdown list
45 | cmbList.BackColor = listBackColor;
46 | cmbList.Font = new Font(this.Font.Name, 10F);
47 | cmbList.ForeColor = listTextColor;
48 | cmbList.SelectedIndexChanged += new EventHandler(ComboBox_SelectedIndexChanged);//Default event
49 | cmbList.TextChanged += new EventHandler(ComboBox_TextChanged);//Refresh text
50 |
51 | //Button: Icon
52 | btnIcon.Dock = DockStyle.Right;
53 | btnIcon.FlatStyle = FlatStyle.Flat;
54 | btnIcon.FlatAppearance.BorderSize = 0;
55 | btnIcon.BackColor = backColor;
56 | btnIcon.Size = new Size(30, 30);
57 | btnIcon.Cursor = Cursors.Hand;
58 | btnIcon.Click += new EventHandler(Icon_Click);//Open dropdown list
59 | btnIcon.Paint += new PaintEventHandler(Icon_Paint);//Draw icon
60 |
61 | //Label: Text
62 | lblText.Dock = DockStyle.Fill;
63 | lblText.AutoSize = false;
64 | lblText.BackColor = backColor;
65 | lblText.TextAlign = ContentAlignment.MiddleLeft;
66 | lblText.Padding = new Padding(8, 0, 0, 0);
67 | lblText.Font = new Font(this.Font.Name, 10F);
68 | //->Attach label events to user control event
69 | lblText.Click += new EventHandler(Surface_Click);//Select combo box
70 | lblText.MouseEnter += new EventHandler(Surface_MouseEnter);
71 | lblText.MouseLeave += new EventHandler(Surface_MouseLeave);
72 |
73 | //User Control
74 | this.Controls.Add(lblText);//2
75 | this.Controls.Add(btnIcon);//1
76 | this.Controls.Add(cmbList);//0
77 | this.MinimumSize = new Size(200, 30);
78 | this.Size = new Size(200, 30);
79 | this.ForeColor = Color.DimGray;
80 | this.Padding = new Padding(borderSize);//Border Size
81 | this.Font = new Font(this.Font.Name, 10F);
82 | base.BackColor = borderColor; //Border Color
83 | this.Load += new System.EventHandler(this.RJComboBox_Load);
84 | this.ResumeLayout();
85 | AdjustComboBoxDimensions();
86 | }
87 | #endregion
88 |
89 | //Properties
90 | #region -> Appearance properties
91 | [Category("RJ Code - Appearance")]
92 | public new Color BackColor
93 | {
94 | get { return backColor; }
95 | set
96 | {
97 | backColor = value;
98 | lblText.BackColor = backColor;
99 | btnIcon.BackColor = backColor;
100 | }
101 | }
102 |
103 | [Category("RJ Code - Appearance")]
104 | public Color IconColor
105 | {
106 | get { return iconColor; }
107 | set
108 | {
109 | iconColor = value;
110 | btnIcon.Invalidate();//Redraw icon
111 | }
112 | }
113 |
114 | [Category("RJ Code - Appearance")]
115 | public Color ListBackColor
116 | {
117 | get { return listBackColor; }
118 | set
119 | {
120 | listBackColor = value;
121 | cmbList.BackColor = listBackColor;
122 | }
123 | }
124 |
125 | [Category("RJ Code - Appearance")]
126 | public Color ListTextColor
127 | {
128 | get { return listTextColor; }
129 | set
130 | {
131 | listTextColor = value;
132 | cmbList.ForeColor = listTextColor;
133 | }
134 | }
135 |
136 | [Category("RJ Code - Appearance")]
137 | public Color BorderColor
138 | {
139 | get { return borderColor; }
140 | set
141 | {
142 | borderColor = value;
143 | base.BackColor = borderColor; //Border Color
144 | }
145 | }
146 |
147 | [Category("RJ Code - Appearance")]
148 | public int BorderSize
149 | {
150 | get { return borderSize; }
151 | set
152 | {
153 | borderSize = value;
154 | this.Padding = new Padding(borderSize);//Border Size
155 | AdjustComboBoxDimensions();
156 | }
157 | }
158 |
159 | [Category("RJ Code - Appearance")]
160 | public override Color ForeColor
161 | {
162 | get { return base.ForeColor; }
163 | set
164 | {
165 | base.ForeColor = value;
166 | lblText.ForeColor = value;
167 | }
168 | }
169 |
170 | [Category("RJ Code - Appearance")]
171 | public override Font Font
172 | {
173 | get { return base.Font; }
174 | set
175 | {
176 | base.Font = value;
177 | lblText.Font = value;
178 | cmbList.Font = value;//Optional
179 | AdjustComboBoxDimensions();
180 | }
181 | }
182 |
183 | [Category("RJ Code - Appearance")]
184 | public string Texts
185 | {
186 | get { return lblText.Text; }
187 | set { lblText.Text = value; }
188 | }
189 |
190 | [Category("RJ Code - Appearance")]
191 | public ComboBoxStyle DropDownStyle
192 | {
193 | get { return cmbList.DropDownStyle; }
194 | set
195 | {
196 | if (cmbList.DropDownStyle != ComboBoxStyle.Simple)
197 | cmbList.DropDownStyle = value;
198 | }
199 | }
200 | #endregion
201 |
202 | #region -> Data properties
203 |
204 | [Category("RJ Code - Data")]
205 | [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
206 | [Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
207 | [Localizable(true)]
208 | [MergableProperty(false)]
209 | public ComboBox.ObjectCollection Items
210 | {
211 | get { return cmbList.Items; }
212 | }
213 |
214 | [Category("RJ Code - Data")]
215 | [AttributeProvider(typeof(IListSource))]
216 | [DefaultValue(null)]
217 | public object DataSource
218 | {
219 | get { return cmbList.DataSource; }
220 | set { cmbList.DataSource = value; }
221 | }
222 |
223 | [Category("RJ Code - Data")]
224 | [Browsable(true)]
225 | [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
226 | [Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
227 | [EditorBrowsable(EditorBrowsableState.Always)]
228 | [Localizable(true)]
229 | public AutoCompleteStringCollection AutoCompleteCustomSource
230 | {
231 | get { return cmbList.AutoCompleteCustomSource; }
232 | set { cmbList.AutoCompleteCustomSource = value; }
233 | }
234 |
235 | [Category("RJ Code - Data")]
236 | [Browsable(true)]
237 | [DefaultValue(AutoCompleteSource.None)]
238 | [EditorBrowsable(EditorBrowsableState.Always)]
239 | public AutoCompleteSource AutoCompleteSource
240 | {
241 | get { return cmbList.AutoCompleteSource; }
242 | set { cmbList.AutoCompleteSource = value; }
243 | }
244 |
245 | [Category("RJ Code - Data")]
246 | [Browsable(true)]
247 | [DefaultValue(AutoCompleteMode.None)]
248 | [EditorBrowsable(EditorBrowsableState.Always)]
249 | public AutoCompleteMode AutoCompleteMode
250 | {
251 | get { return cmbList.AutoCompleteMode; }
252 | set { cmbList.AutoCompleteMode = value; }
253 | }
254 |
255 | [Category("RJ Code - Data")]
256 | [Bindable(true)]
257 | [Browsable(false)]
258 | [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
259 | public object SelectedItem
260 | {
261 | get { return cmbList.SelectedItem; }
262 | set { cmbList.SelectedItem = value; }
263 | }
264 |
265 | [Category("RJ Code - Data")]
266 | [Browsable(false)]
267 | [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
268 | public int SelectedIndex
269 | {
270 | get { return cmbList.SelectedIndex; }
271 | set { cmbList.SelectedIndex = value; }
272 | }
273 |
274 | [Category("RJ Code - Data")]
275 | [DefaultValue("")]
276 | [Editor("System.Windows.Forms.Design.DataMemberFieldEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
277 | [TypeConverter("System.Windows.Forms.Design.DataMemberFieldConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
278 | public string DisplayMember
279 | {
280 | get { return cmbList.DisplayMember; }
281 | set { cmbList.DisplayMember = value; }
282 | }
283 |
284 | [Category("RJ Code - Data")]
285 | [DefaultValue("")]
286 | [Editor("System.Windows.Forms.Design.DataMemberFieldEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
287 | public string ValueMember
288 | {
289 | get { return cmbList.ValueMember; }
290 | set { cmbList.ValueMember = value; }
291 | }
292 | #endregion
293 |
294 | #region -> Private methods
295 | private void AdjustComboBoxDimensions()
296 | {
297 | cmbList.Width = lblText.Width;
298 | cmbList.Location = new Point()
299 | {
300 | X = this.Width - this.Padding.Right - cmbList.Width,
301 | Y = lblText.Bottom - cmbList.Height
302 | };
303 | if (cmbList.Height >= this.Height)
304 | {
305 | this.Height = cmbList.Height + (this.borderSize*2);
306 | }
307 | }
308 | #endregion
309 |
310 | #region -> Event methods
311 |
312 | //-> Default event
313 | private void ComboBox_SelectedIndexChanged(object sender, EventArgs e)
314 | {
315 | if (OnSelectedIndexChanged != null)
316 | OnSelectedIndexChanged.Invoke(sender, e);
317 | //Refresh text
318 | lblText.Text = cmbList.Text;
319 | }
320 |
321 | //-> Draw icon
322 | private void Icon_Paint(object sender, PaintEventArgs e)
323 | {
324 | //Fields
325 | int iconWidht = 14;
326 | int iconHeight = 6;
327 | var rectIcon = new Rectangle((btnIcon.Width - iconWidht) / 2, (btnIcon.Height - iconHeight) / 2, iconWidht, iconHeight);
328 | Graphics graph = e.Graphics;
329 |
330 | //Draw arrow down icon
331 | using (GraphicsPath path = new GraphicsPath())
332 | using (Pen pen = new Pen(iconColor, 2))
333 | {
334 | graph.SmoothingMode = SmoothingMode.AntiAlias;
335 | path.AddLine(rectIcon.X, rectIcon.Y, rectIcon.X + (iconWidht / 2), rectIcon.Bottom);
336 | path.AddLine(rectIcon.X + (iconWidht / 2), rectIcon.Bottom, rectIcon.Right, rectIcon.Y);
337 | graph.DrawPath(pen, path);
338 | }
339 | }
340 |
341 | //-> Items actions
342 | private void Icon_Click(object sender, EventArgs e)
343 | {
344 | //Open dropdown list
345 | cmbList.Select();
346 | cmbList.DroppedDown = true;
347 | }
348 | private void Surface_Click(object sender, EventArgs e)
349 | {
350 | //Attach label click to user control click
351 | this.OnClick(e);
352 | //Select combo box
353 | cmbList.Select();
354 | if (cmbList.DropDownStyle == ComboBoxStyle.DropDownList)
355 | cmbList.DroppedDown = true;//Open dropdown list
356 | }
357 | private void ComboBox_TextChanged(object sender, EventArgs e)
358 | {
359 | //Refresh text
360 | lblText.Text = cmbList.Text;
361 | }
362 |
363 | //->Attach label events to user control event
364 | private void Surface_MouseLeave(object sender, EventArgs e)
365 | {
366 | this.OnMouseLeave(e);
367 | }
368 |
369 | private void Surface_MouseEnter(object sender, EventArgs e)
370 | {
371 | this.OnMouseEnter(e);
372 | }
373 | //::::+
374 | #endregion
375 |
376 | #region -> Overridden methods
377 | protected override void OnResize(EventArgs e)
378 | {
379 | base.OnResize(e);
380 | if (DesignMode)
381 | AdjustComboBoxDimensions();
382 | }
383 | #endregion
384 |
385 | private void RJComboBox_Load(object sender, EventArgs e)
386 | {
387 | AdjustComboBoxDimensions();
388 | }
389 | }
390 | }
391 |
--------------------------------------------------------------------------------
/CustomControls/RJControls/RJDatePicker.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using System.Windows.Forms;
8 | using System.Drawing;
9 | using System.Drawing.Drawing2D;
10 |
11 | namespace CustomControls.RJControls
12 | {
13 | public class RJDatePicker : DateTimePicker
14 | {
15 | //Fields
16 | //-> Appearance
17 | private Color skinColor = Color.MediumSlateBlue;
18 | private Color textColor = Color.White;
19 | private Color borderColor = Color.PaleVioletRed;
20 | private int borderSize = 0;
21 |
22 | //-> Other Values
23 | private bool droppedDown = false;
24 | private Image calendarIcon = Properties.Resources.calendarWhite;
25 | private RectangleF iconButtonArea;
26 | private const int calendarIconWidth = 34;
27 | private const int arrowIconWidth = 17;
28 |
29 | //Properties
30 | public Color SkinColor
31 | {
32 | get { return skinColor; }
33 | set
34 | {
35 | skinColor = value;
36 | if (skinColor.GetBrightness() >= 0.6F)
37 | calendarIcon = Properties.Resources.calendarDark;
38 | else calendarIcon = Properties.Resources.calendarWhite;
39 | this.Invalidate();
40 | }
41 | }
42 |
43 | public Color TextColor
44 | {
45 | get { return textColor; }
46 | set
47 | {
48 | textColor = value;
49 | this.Invalidate();
50 | }
51 | }
52 |
53 | public Color BorderColor
54 | {
55 | get { return borderColor; }
56 | set
57 | {
58 | borderColor = value;
59 | this.Invalidate();
60 | }
61 | }
62 |
63 | public int BorderSize
64 | {
65 | get { return borderSize; }
66 | set
67 | {
68 | borderSize = value;
69 | this.Invalidate();
70 | }
71 | }
72 |
73 | //Constructor
74 | public RJDatePicker()
75 | {
76 | this.SetStyle(ControlStyles.UserPaint, true);
77 | this.MinimumSize = new Size(0, 35);
78 | this.Font = new Font(this.Font.Name, 9.5F);
79 | }
80 |
81 | //Overridden methods
82 | protected override void OnDropDown(EventArgs eventargs)
83 | {
84 | base.OnDropDown(eventargs);
85 | droppedDown = true;
86 | }
87 | protected override void OnCloseUp(EventArgs eventargs)
88 | {
89 | base.OnCloseUp(eventargs);
90 | droppedDown = false;
91 | }
92 | protected override void OnKeyPress(KeyPressEventArgs e)
93 | {
94 | base.OnKeyPress(e);
95 | e.Handled = true;
96 | }
97 | protected override void OnPaint(PaintEventArgs e)
98 | {
99 | using (Graphics graphics = this.CreateGraphics())
100 | using (Pen penBorder = new Pen(borderColor, borderSize))
101 | using (SolidBrush skinBrush = new SolidBrush(skinColor))
102 | using (SolidBrush openIconBrush = new SolidBrush(Color.FromArgb(50, 64, 64, 64)))
103 | using (SolidBrush textBrush = new SolidBrush(textColor))
104 | using (StringFormat textFormat = new StringFormat())
105 | {
106 | RectangleF clientArea = new RectangleF(0, 0, this.Width - 0.5F, this.Height - 0.5F);
107 | RectangleF iconArea = new RectangleF(clientArea.Width - calendarIconWidth, 0, calendarIconWidth, clientArea.Height);
108 | penBorder.Alignment = PenAlignment.Inset;
109 | textFormat.LineAlignment = StringAlignment.Center;
110 |
111 | //Draw surface
112 | graphics.FillRectangle(skinBrush, clientArea);
113 | //Draw text
114 | graphics.DrawString(" " + this.Text, this.Font, textBrush, clientArea, textFormat);
115 | //Draw open calendar icon highlight
116 | if (droppedDown == true) graphics.FillRectangle(openIconBrush, iconArea);
117 | //Draw border
118 | if (borderSize >= 1) graphics.DrawRectangle(penBorder, clientArea.X, clientArea.Y, clientArea.Width, clientArea.Height);
119 | //Draw icon
120 | graphics.DrawImage(calendarIcon, this.Width - calendarIcon.Width - 9, (this.Height - calendarIcon.Height) / 2);
121 |
122 | }
123 | }
124 |
125 | protected override void OnHandleCreated(EventArgs e)
126 | {
127 | base.OnHandleCreated(e);
128 | int iconWidth = GetIconButtonWidth();
129 | iconButtonArea = new RectangleF(this.Width - iconWidth, 0, iconWidth, this.Height);
130 | }
131 | protected override void OnMouseMove(MouseEventArgs e)
132 | {
133 | base.OnMouseMove(e);
134 | if (iconButtonArea.Contains(e.Location))
135 | this.Cursor = Cursors.Hand;
136 | else this.Cursor = Cursors.Default;
137 | }
138 |
139 | //Private methods
140 | private int GetIconButtonWidth()
141 | {
142 | int textWidh = TextRenderer.MeasureText(this.Text, this.Font).Width;
143 | if (textWidh <= this.Width - (calendarIconWidth + 20))
144 | return calendarIconWidth;
145 | else return arrowIconWidth;
146 | }
147 | }
148 | }
149 |
--------------------------------------------------------------------------------
/CustomControls/RJControls/RJDropdownMenu.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using System.Windows.Forms;
8 | using System.Drawing;
9 | using System.Drawing.Drawing2D;
10 | using System.ComponentModel;
11 |
12 | namespace CustomControls.RJControls
13 | {
14 | public class RJDropdownMenu : ContextMenuStrip
15 | {
16 | //Fields
17 | private bool isMainMenu;
18 | private int menuItemHeight = 25;
19 | private Color menuItemTextColor = Color.Empty;//No color, The default color is set in the MenuRenderer class
20 | private Color primaryColor = Color.Empty;//No color, The default color is set in the MenuRenderer class
21 |
22 | private Bitmap menuItemHeaderSize;
23 |
24 | //Constructor
25 | public RJDropdownMenu(IContainer container)
26 | : base(container)
27 | {
28 |
29 | }
30 |
31 | //Properties
32 | //Optionally, hide the properties in the toolbox to avoid the problem of displaying and/or
33 | //saving control property changes in the designer at design time in Visual Studio.
34 | //If the problem I mention does not occur you can expose the properties and manipulate them from the toolbox.
35 | [Browsable(false)]
36 | public bool IsMainMenu
37 | {
38 | get { return isMainMenu; }
39 | set { isMainMenu = value; }
40 | }
41 |
42 | [Browsable(false)]
43 | public int MenuItemHeight
44 | {
45 | get { return menuItemHeight; }
46 | set { menuItemHeight = value; }
47 | }
48 |
49 | [Browsable(false)]
50 | public Color MenuItemTextColor
51 | {
52 | get { return menuItemTextColor; }
53 | set { menuItemTextColor = value; }
54 | }
55 |
56 | [Browsable(false)]
57 | public Color PrimaryColor
58 | {
59 | get { return primaryColor; }
60 | set { primaryColor = value; }
61 | }
62 |
63 | //Private methods
64 | private void LoadMenuItemHeight()
65 | {
66 | if (isMainMenu)
67 | menuItemHeaderSize = new Bitmap(25, 45);
68 | else menuItemHeaderSize = new Bitmap(20, menuItemHeight);
69 |
70 | foreach (ToolStripMenuItem menuItemL1 in this.Items)
71 | {
72 | menuItemL1.ImageScaling = ToolStripItemImageScaling.None;
73 | if (menuItemL1.Image == null) menuItemL1.Image = menuItemHeaderSize;
74 |
75 | foreach (ToolStripMenuItem menuItemL2 in menuItemL1.DropDownItems)
76 | {
77 | menuItemL2.ImageScaling = ToolStripItemImageScaling.None;
78 | if (menuItemL2.Image == null) menuItemL2.Image = menuItemHeaderSize;
79 |
80 | foreach (ToolStripMenuItem menuItemL3 in menuItemL2.DropDownItems)
81 | {
82 | menuItemL3.ImageScaling = ToolStripItemImageScaling.None;
83 | if (menuItemL3.Image == null) menuItemL3.Image = menuItemHeaderSize;
84 |
85 | foreach (ToolStripMenuItem menuItemL4 in menuItemL3.DropDownItems)
86 | {
87 | menuItemL4.ImageScaling = ToolStripItemImageScaling.None;
88 | if (menuItemL4.Image == null) menuItemL4.Image = menuItemHeaderSize;
89 | ///Level 5++
90 | }
91 | }
92 | }
93 | }
94 | }
95 |
96 | //Overrides
97 | protected override void OnHandleCreated(EventArgs e)
98 | {
99 | base.OnHandleCreated(e);
100 | if (this.DesignMode == false)
101 | {
102 | this.Renderer = new MenuRenderer(isMainMenu, primaryColor, menuItemTextColor);
103 | LoadMenuItemHeight();
104 | }
105 | }
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/CustomControls/RJControls/RJProgressBar.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using System.Windows.Forms;
8 | using System.Drawing;
9 | using System.Drawing.Drawing2D;
10 | using System.ComponentModel;
11 |
12 | namespace CustomControls.RJControls
13 | {
14 | public enum TextPosition
15 | {
16 | Left,
17 | Right,
18 | Center,
19 | Sliding,
20 | None
21 | }
22 |
23 | class RJProgressBar : ProgressBar
24 | {
25 | //Fields
26 | //-> Appearance
27 | private Color channelColor = Color.LightSteelBlue;
28 | private Color sliderColor = Color.RoyalBlue;
29 | private Color foreBackColor = Color.RoyalBlue;
30 | private int channelHeight = 6;
31 | private int sliderHeight = 6;
32 | private TextPosition showValue = TextPosition.Right;
33 | private string symbolBefore = "";
34 | private string symbolAfter = "";
35 | private bool showMaximun = false;
36 |
37 | //-> Others
38 | private bool paintedBack = false;
39 | private bool stopPainting = false;
40 |
41 | //Constructor
42 | public RJProgressBar()
43 | {
44 | this.SetStyle(ControlStyles.UserPaint, true);
45 | this.ForeColor = Color.White;
46 | }
47 |
48 | //Propertiesfff
49 | [Category("RJ Code Advance")]
50 | public Color ChannelColor
51 | {
52 | get { return channelColor; }
53 | set
54 | {
55 | channelColor = value;
56 | this.Invalidate();
57 | }
58 | }
59 |
60 | [Category("RJ Code Advance")]
61 | public Color SliderColor
62 | {
63 | get { return sliderColor; }
64 | set
65 | {
66 | sliderColor = value;
67 | this.Invalidate();
68 | }
69 | }
70 |
71 | [Category("RJ Code Advance")]
72 | public Color ForeBackColor
73 | {
74 | get { return foreBackColor; }
75 | set
76 | {
77 | foreBackColor = value;
78 | this.Invalidate();
79 | }
80 | }
81 |
82 | [Category("RJ Code Advance")]
83 | public int ChannelHeight
84 | {
85 | get { return channelHeight; }
86 | set
87 | {
88 | channelHeight = value;
89 | this.Invalidate();
90 | }
91 | }
92 |
93 | [Category("RJ Code Advance")]
94 | public int SliderHeight
95 | {
96 | get { return sliderHeight; }
97 | set
98 | {
99 | sliderHeight = value;
100 | this.Invalidate();
101 | }
102 | }
103 |
104 | [Category("RJ Code Advance")]
105 | public TextPosition ShowValue
106 | {
107 | get { return showValue; }
108 | set
109 | {
110 | showValue = value;
111 | this.Invalidate();
112 | }
113 | }
114 |
115 | [Category("RJ Code Advance")]
116 | public string SymbolBefore
117 | {
118 | get { return symbolBefore; }
119 | set
120 | {
121 | symbolBefore = value;
122 | this.Invalidate();
123 | }
124 | }
125 |
126 | [Category("RJ Code Advance")]
127 | public string SymbolAfter
128 | {
129 | get { return symbolAfter; }
130 | set
131 | {
132 | symbolAfter = value;
133 | this.Invalidate();
134 | }
135 | }
136 |
137 | [Category("RJ Code Advance")]
138 | public bool ShowMaximun
139 | {
140 | get { return showMaximun; }
141 | set
142 | {
143 | showMaximun = value;
144 | this.Invalidate();
145 | }
146 | }
147 |
148 | [Category("RJ Code Advance")]
149 | [Browsable(true)]
150 | [EditorBrowsable(EditorBrowsableState.Always)]
151 | public override Font Font
152 | {
153 | get { return base.Font; }
154 | set
155 | {
156 | base.Font = value;
157 | }
158 | }
159 |
160 | [Category("RJ Code Advance")]
161 | public override Color ForeColor
162 | {
163 | get { return base.ForeColor; }
164 | set
165 | {
166 | base.ForeColor = value;
167 | }
168 | }
169 |
170 | //-> Paint the background & channel
171 | protected override void OnPaintBackground(PaintEventArgs pevent)
172 | {
173 | if (stopPainting == false)
174 | {
175 | if (paintedBack == false)
176 | {
177 | //Fields
178 | Graphics graph = pevent.Graphics;
179 | Rectangle rectChannel = new Rectangle(0, 0, this.Width, ChannelHeight);
180 | using (var brushChannel = new SolidBrush(channelColor))
181 | {
182 | if (channelHeight >= sliderHeight)
183 | rectChannel.Y = this.Height - channelHeight;
184 | else rectChannel.Y = this.Height - ((channelHeight + sliderHeight) / 2);
185 |
186 | //Painting
187 | graph.Clear(this.Parent.BackColor);//Surface
188 | graph.FillRectangle(brushChannel, rectChannel);//Channel
189 |
190 | //Stop painting the back & Channel
191 | if (this.DesignMode == false)
192 | paintedBack = true;
193 | }
194 | }
195 | //Reset painting the back & channel
196 | if (this.Value == this.Maximum || this.Value == this.Minimum)
197 | paintedBack = false;
198 | }
199 | }
200 | //-> Paint slider
201 | protected override void OnPaint(PaintEventArgs e)
202 | {
203 | if (stopPainting == false)
204 | {
205 | //Fields
206 | Graphics graph = e.Graphics;
207 | double scaleFactor = (((double)this.Value - this.Minimum) / ((double)this.Maximum - this.Minimum));
208 | int sliderWidth = (int)(this.Width * scaleFactor);
209 | Rectangle rectSlider = new Rectangle(0, 0, sliderWidth, sliderHeight);
210 | using (var brushSlider = new SolidBrush(sliderColor))
211 | {
212 | if (sliderHeight >= channelHeight)
213 | rectSlider.Y = this.Height - sliderHeight;
214 | else rectSlider.Y = this.Height - ((sliderHeight + channelHeight) / 2);
215 |
216 | //Painting
217 | if (sliderWidth > 1) //Slider
218 | graph.FillRectangle(brushSlider, rectSlider);
219 | if (showValue != TextPosition.None) //Text
220 | DrawValueText(graph, sliderWidth, rectSlider);
221 | }
222 | }
223 | if (this.Value == this.Maximum) stopPainting = true;//Stop painting
224 | else stopPainting = false; //Keep painting
225 | }
226 |
227 | //-> Paint value text
228 | private void DrawValueText(Graphics graph, int sliderWidth, Rectangle rectSlider)
229 | {
230 | //Fields
231 | string text = symbolBefore + this.Value.ToString() + symbolAfter;
232 | if (showMaximun) text = text + "/" + symbolBefore + this.Maximum.ToString() + symbolAfter;
233 | var textSize = TextRenderer.MeasureText(text, this.Font);
234 | var rectText = new Rectangle(0, 0, textSize.Width, textSize.Height + 2);
235 | using (var brushText = new SolidBrush(this.ForeColor))
236 | using (var brushTextBack = new SolidBrush(foreBackColor))
237 | using (var textFormat = new StringFormat())
238 | {
239 | switch (showValue)
240 | {
241 | case TextPosition.Left:
242 | rectText.X = 0;
243 | textFormat.Alignment = StringAlignment.Near;
244 | break;
245 |
246 | case TextPosition.Right:
247 | rectText.X = this.Width - textSize.Width;
248 | textFormat.Alignment = StringAlignment.Far;
249 | break;
250 |
251 | case TextPosition.Center:
252 | rectText.X = (this.Width - textSize.Width) / 2;
253 | textFormat.Alignment = StringAlignment.Center;
254 | break;
255 |
256 | case TextPosition.Sliding:
257 | rectText.X = sliderWidth - textSize.Width;
258 | textFormat.Alignment = StringAlignment.Center;
259 | //Clean previous text surface
260 | using (var brushClear = new SolidBrush(this.Parent.BackColor))
261 | {
262 | var rect = rectSlider;
263 | rect.Y = rectText.Y;
264 | rect.Height = rectText.Height;
265 | graph.FillRectangle(brushClear, rect);
266 | }
267 | break;
268 | }
269 | //Painting
270 | graph.FillRectangle(brushTextBack, rectText);
271 | graph.DrawString(text, this.Font, brushText, rectText, textFormat);
272 | }
273 | }
274 |
275 |
276 | }
277 | }
278 |
--------------------------------------------------------------------------------
/CustomControls/RJControls/RJRadioButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using System.Windows.Forms;
8 | using System.Drawing;
9 | using System.Drawing.Drawing2D;
10 |
11 | namespace CustomControls.RJControls
12 | {
13 | class RJRadioButton : RadioButton
14 | {
15 | //Fields
16 | private Color checkedColor = Color.MediumSlateBlue;
17 | private Color unCheckedColor = Color.Gray;
18 |
19 | //Properties
20 | public Color CheckedColor
21 | {
22 | get
23 | {
24 | return checkedColor;
25 | }
26 |
27 | set
28 | {
29 | checkedColor = value;
30 | this.Invalidate();
31 | }
32 | }
33 |
34 | public Color UnCheckedColor
35 | {
36 | get
37 | {
38 | return unCheckedColor;
39 | }
40 |
41 | set
42 | {
43 | unCheckedColor = value;
44 | this.Invalidate();
45 | }
46 | }
47 |
48 | //Constructor
49 | public RJRadioButton()
50 | {
51 | this.MinimumSize = new Size(0, 21);
52 | //Add a padding of 10 to the left to have a considerable distance between the text and the RadioButton.
53 | this.Padding = new Padding(10,0,0,0);
54 | }
55 |
56 | //Overridden methods
57 | protected override void OnPaint(PaintEventArgs pevent)
58 | {
59 | //Fields
60 | Graphics graphics = pevent.Graphics;
61 | graphics.SmoothingMode = SmoothingMode.AntiAlias;
62 | float rbBorderSize = 18F;
63 | float rbCheckSize = 12F;
64 | RectangleF rectRbBorder = new RectangleF()
65 | {
66 | X = 0.5F,
67 | Y = (this.Height - rbBorderSize) / 2, //Center
68 | Width = rbBorderSize,
69 | Height = rbBorderSize
70 | };
71 | RectangleF rectRbCheck = new RectangleF()
72 | {
73 | X = rectRbBorder.X + ((rectRbBorder.Width - rbCheckSize) / 2), //Center
74 | Y = (this.Height - rbCheckSize) / 2, //Center
75 | Width = rbCheckSize,
76 | Height = rbCheckSize
77 | };
78 |
79 | //Drawing
80 | using (Pen penBorder = new Pen(checkedColor, 1.6F))
81 | using (SolidBrush brushRbCheck = new SolidBrush(checkedColor))
82 | using (SolidBrush brushText = new SolidBrush(this.ForeColor))
83 | {
84 | //Draw surface
85 | graphics.Clear(this.BackColor);
86 | //Draw Radio Button
87 | if (this.Checked)
88 | {
89 | graphics.DrawEllipse(penBorder, rectRbBorder);//Circle border
90 | graphics.FillEllipse(brushRbCheck, rectRbCheck); //Circle Radio Check
91 | }
92 | else
93 | {
94 | penBorder.Color = unCheckedColor;
95 | graphics.DrawEllipse(penBorder, rectRbBorder); //Circle border
96 | }
97 | //Draw text
98 | graphics.DrawString(this.Text, this.Font, brushText,
99 | rbBorderSize + 8, (this.Height - TextRenderer.MeasureText(this.Text, this.Font).Height) / 2);//Y=Center
100 | }
101 | }
102 |
103 | //X-> Obsolete code, this was replaced by the Padding property in the constructor
104 | //(this.Padding = new Padding(10,0,0,0);)
105 | //protected override void OnResize(EventArgs e)
106 | //{
107 | // base.OnResize(e);
108 | // this.Width = TextRenderer.MeasureText(this.Text, this.Font).Width + 30;
109 | //}
110 | }
111 | }
112 |
--------------------------------------------------------------------------------
/CustomControls/RJControls/RJTextBox.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace CustomControls.RJControls
2 | {
3 | partial class RJTextBox
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.textBox1 = new System.Windows.Forms.TextBox();
32 | this.SuspendLayout();
33 | //
34 | // textBox1
35 | //
36 | this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
37 | this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
38 | this.textBox1.Location = new System.Drawing.Point(10, 7);
39 | this.textBox1.Name = "textBox1";
40 | this.textBox1.Size = new System.Drawing.Size(230, 15);
41 | this.textBox1.TabIndex = 0;
42 | this.textBox1.Click += new System.EventHandler(this.textBox1_Click);
43 | this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
44 | this.textBox1.Enter += new System.EventHandler(this.textBox1_Enter);
45 | this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);
46 | this.textBox1.Leave += new System.EventHandler(this.textBox1_Leave);
47 | this.textBox1.MouseEnter += new System.EventHandler(this.textBox1_MouseEnter);
48 | this.textBox1.MouseLeave += new System.EventHandler(this.textBox1_MouseLeave);
49 | //
50 | // RJTextBox
51 | //
52 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
53 | this.BackColor = System.Drawing.SystemColors.Window;
54 | this.Controls.Add(this.textBox1);
55 | this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
56 | this.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
57 | this.Margin = new System.Windows.Forms.Padding(4);
58 | this.Name = "RJTextBox";
59 | this.Padding = new System.Windows.Forms.Padding(10, 7, 10, 7);
60 | this.Size = new System.Drawing.Size(250, 30);
61 | this.ResumeLayout(false);
62 | this.PerformLayout();
63 |
64 | }
65 |
66 | #endregion
67 |
68 | private System.Windows.Forms.TextBox textBox1;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/CustomControls/RJControls/RJTextBox.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using System.Drawing.Drawing2D;
11 |
12 | namespace CustomControls.RJControls
13 | {
14 | [DefaultEvent("_TextChanged")]
15 | public partial class RJTextBox : UserControl
16 | {
17 | #region -> Fields
18 | //Fields
19 | private Color borderColor = Color.MediumSlateBlue;
20 | private Color borderFocusColor = Color.HotPink;
21 | private int borderSize = 2;
22 | private bool underlinedStyle = false;
23 | private bool isFocused = false;
24 |
25 | private int borderRadius = 0;
26 | private Color placeholderColor = Color.DarkGray;
27 | private string placeholderText = "";
28 | private bool isPlaceholder = false;
29 | private bool isPasswordChar = false;
30 |
31 | //Events
32 | public event EventHandler _TextChanged;
33 |
34 | #endregion
35 |
36 | //-> Constructor
37 | public RJTextBox()
38 | {
39 | //Created by designer
40 | InitializeComponent();
41 | }
42 |
43 | #region -> Properties
44 | [Category("RJ Code Advance")]
45 | public Color BorderColor
46 | {
47 | get { return borderColor; }
48 | set
49 | {
50 | borderColor = value;
51 | this.Invalidate();
52 | }
53 | }
54 |
55 | [Category("RJ Code Advance")]
56 | public Color BorderFocusColor
57 | {
58 | get { return borderFocusColor; }
59 | set { borderFocusColor = value; }
60 | }
61 |
62 | [Category("RJ Code Advance")]
63 | public int BorderSize
64 | {
65 | get { return borderSize; }
66 | set
67 | {
68 | if (value >= 1)
69 | {
70 | borderSize = value;
71 | this.Invalidate();
72 | }
73 | }
74 | }
75 |
76 | [Category("RJ Code Advance")]
77 | public bool UnderlinedStyle
78 | {
79 | get { return underlinedStyle; }
80 | set
81 | {
82 | underlinedStyle = value;
83 | this.Invalidate();
84 | }
85 | }
86 |
87 | [Category("RJ Code Advance")]
88 | public bool PasswordChar
89 | {
90 | get { return isPasswordChar; }
91 | set
92 | {
93 | isPasswordChar = value;
94 | if (!isPlaceholder)
95 | textBox1.UseSystemPasswordChar = value;
96 | }
97 | }
98 |
99 | [Category("RJ Code Advance")]
100 | public bool Multiline
101 | {
102 | get { return textBox1.Multiline; }
103 | set { textBox1.Multiline = value; }
104 | }
105 |
106 | [Category("RJ Code Advance")]
107 | public override Color BackColor
108 | {
109 | get { return base.BackColor; }
110 | set
111 | {
112 | base.BackColor = value;
113 | textBox1.BackColor = value;
114 | }
115 | }
116 |
117 | [Category("RJ Code Advance")]
118 | public override Color ForeColor
119 | {
120 | get { return base.ForeColor; }
121 | set
122 | {
123 | base.ForeColor = value;
124 | textBox1.ForeColor = value;
125 | }
126 | }
127 |
128 | [Category("RJ Code Advance")]
129 | public override Font Font
130 | {
131 | get { return base.Font; }
132 | set
133 | {
134 | base.Font = value;
135 | textBox1.Font = value;
136 | if (this.DesignMode)
137 | UpdateControlHeight();
138 | }
139 | }
140 |
141 | [Category("RJ Code Advance")]
142 | public string Texts
143 | {
144 | get
145 | {
146 | if (isPlaceholder) return "";
147 | else return textBox1.Text;
148 | }
149 | set
150 | {
151 | RemovePlaceholder();//If it is the case.
152 | textBox1.Text = value;
153 | SetPlaceholder();//If it is the case.
154 | }
155 | }
156 |
157 | [Category("RJ Code Advance")]
158 | public int BorderRadius
159 | {
160 | get { return borderRadius; }
161 | set
162 | {
163 | if (value >= 0)
164 | {
165 | borderRadius = value;
166 | this.Invalidate();//Redraw control
167 | }
168 | }
169 | }
170 |
171 | [Category("RJ Code Advance")]
172 | public Color PlaceholderColor
173 | {
174 | get { return placeholderColor; }
175 | set
176 | {
177 | placeholderColor = value;
178 | if (isPlaceholder)
179 | textBox1.ForeColor = value;
180 | }
181 | }
182 |
183 | [Category("RJ Code Advance")]
184 | public string PlaceholderText
185 | {
186 | get { return placeholderText; }
187 | set
188 | {
189 | placeholderText = value;
190 | textBox1.Text = "";
191 | SetPlaceholder();
192 | }
193 | }
194 | #endregion
195 |
196 | #region -> Overridden methods
197 | protected override void OnResize(EventArgs e)
198 | {
199 | base.OnResize(e);
200 | if (this.DesignMode)
201 | UpdateControlHeight();
202 | }
203 | protected override void OnLoad(EventArgs e)
204 | {
205 | base.OnLoad(e);
206 | UpdateControlHeight();
207 | }
208 | protected override void OnPaint(PaintEventArgs e)
209 | {
210 | base.OnPaint(e);
211 | Graphics graph = e.Graphics;
212 |
213 | if (borderRadius > 1)//Rounded TextBox
214 | {
215 | //-Fields
216 | var rectBorderSmooth = this.ClientRectangle;
217 | var rectBorder = Rectangle.Inflate(rectBorderSmooth, -borderSize, -borderSize);
218 | int smoothSize = borderSize > 0 ? borderSize : 1;
219 |
220 | using (GraphicsPath pathBorderSmooth = GetFigurePath(rectBorderSmooth, borderRadius))
221 | using (GraphicsPath pathBorder = GetFigurePath(rectBorder, borderRadius - borderSize))
222 | using (Pen penBorderSmooth = new Pen(this.Parent.BackColor, smoothSize))
223 | using (Pen penBorder = new Pen(borderColor, borderSize))
224 | {
225 | //-Drawing
226 | this.Region = new Region(pathBorderSmooth);//Set the rounded region of UserControl
227 | if (borderRadius > 15) SetTextBoxRoundedRegion();//Set the rounded region of TextBox component
228 | graph.SmoothingMode = SmoothingMode.AntiAlias;
229 | penBorder.Alignment = System.Drawing.Drawing2D.PenAlignment.Center;
230 | if (isFocused) penBorder.Color = borderFocusColor;
231 |
232 | if (underlinedStyle) //Line Style
233 | {
234 | //Draw border smoothing
235 | graph.DrawPath(penBorderSmooth, pathBorderSmooth);
236 | //Draw border
237 | graph.SmoothingMode = SmoothingMode.None;
238 | graph.DrawLine(penBorder, 0, this.Height - 1, this.Width, this.Height - 1);
239 | }
240 | else //Normal Style
241 | {
242 | //Draw border smoothing
243 | graph.DrawPath(penBorderSmooth, pathBorderSmooth);
244 | //Draw border
245 | graph.DrawPath(penBorder, pathBorder);
246 | }
247 | }
248 | }
249 | else //Square/Normal TextBox
250 | {
251 | //Draw border
252 | using (Pen penBorder = new Pen(borderColor, borderSize))
253 | {
254 | this.Region = new Region(this.ClientRectangle);
255 | penBorder.Alignment = System.Drawing.Drawing2D.PenAlignment.Inset;
256 | if (isFocused) penBorder.Color = borderFocusColor;
257 |
258 | if (underlinedStyle) //Line Style
259 | graph.DrawLine(penBorder, 0, this.Height - 1, this.Width, this.Height - 1);
260 | else //Normal Style
261 | graph.DrawRectangle(penBorder, 0, 0, this.Width - 0.5F, this.Height - 0.5F);
262 | }
263 | }
264 | }
265 | #endregion
266 |
267 | #region -> Private methods
268 | private void SetPlaceholder()
269 | {
270 | if (string.IsNullOrWhiteSpace(textBox1.Text) && placeholderText != "")
271 | {
272 | isPlaceholder = true;
273 | textBox1.Text = placeholderText;
274 | textBox1.ForeColor = placeholderColor;
275 | if (isPasswordChar)
276 | textBox1.UseSystemPasswordChar = false;
277 | }
278 | }
279 | private void RemovePlaceholder()
280 | {
281 | if (isPlaceholder && placeholderText != "")
282 | {
283 | isPlaceholder = false;
284 | textBox1.Text = "";
285 | textBox1.ForeColor = this.ForeColor;
286 | if (isPasswordChar)
287 | textBox1.UseSystemPasswordChar = true;
288 | }
289 | }
290 | private GraphicsPath GetFigurePath(Rectangle rect, int radius)
291 | {
292 | GraphicsPath path = new GraphicsPath();
293 | float curveSize = radius * 2F;
294 |
295 | path.StartFigure();
296 | path.AddArc(rect.X, rect.Y, curveSize, curveSize, 180, 90);
297 | path.AddArc(rect.Right - curveSize, rect.Y, curveSize, curveSize, 270, 90);
298 | path.AddArc(rect.Right - curveSize, rect.Bottom - curveSize, curveSize, curveSize, 0, 90);
299 | path.AddArc(rect.X, rect.Bottom - curveSize, curveSize, curveSize, 90, 90);
300 | path.CloseFigure();
301 | return path;
302 | }
303 | private void SetTextBoxRoundedRegion()
304 | {
305 | GraphicsPath pathTxt;
306 | if (Multiline)
307 | {
308 | pathTxt = GetFigurePath(textBox1.ClientRectangle, borderRadius - borderSize);
309 | textBox1.Region = new Region(pathTxt);
310 | }
311 | else
312 | {
313 | pathTxt = GetFigurePath(textBox1.ClientRectangle, borderSize * 2);
314 | textBox1.Region = new Region(pathTxt);
315 | }
316 | pathTxt.Dispose();
317 | }
318 | private void UpdateControlHeight()
319 | {
320 | if (textBox1.Multiline == false)
321 | {
322 | int txtHeight = TextRenderer.MeasureText("Text", this.Font).Height + 1;
323 | textBox1.Multiline = true;
324 | textBox1.MinimumSize = new Size(0, txtHeight);
325 | textBox1.Multiline = false;
326 |
327 | this.Height = textBox1.Height + this.Padding.Top + this.Padding.Bottom;
328 | }
329 | }
330 | #endregion
331 |
332 | #region -> TextBox events
333 | private void textBox1_TextChanged(object sender, EventArgs e)
334 | {
335 | if (_TextChanged != null)
336 | _TextChanged.Invoke(sender, e);
337 | }
338 | private void textBox1_Click(object sender, EventArgs e)
339 | {
340 | this.OnClick(e);
341 | }
342 | private void textBox1_MouseEnter(object sender, EventArgs e)
343 | {
344 | this.OnMouseEnter(e);
345 | }
346 | private void textBox1_MouseLeave(object sender, EventArgs e)
347 | {
348 | this.OnMouseLeave(e);
349 | }
350 | private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
351 | {
352 | this.OnKeyPress(e);
353 | }
354 |
355 | private void textBox1_Enter(object sender, EventArgs e)
356 | {
357 | isFocused = true;
358 | this.Invalidate();
359 | RemovePlaceholder();
360 | }
361 | private void textBox1_Leave(object sender, EventArgs e)
362 | {
363 | isFocused = false;
364 | this.Invalidate();
365 | SetPlaceholder();
366 | }
367 | ///::::+
368 | #endregion
369 | }
370 | }
371 |
--------------------------------------------------------------------------------
/CustomControls/RJControls/RJTextBox.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/CustomControls/RJControls/RJToggleButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using System.Windows.Forms;
8 | using System.Drawing;
9 | using System.Drawing.Drawing2D;
10 | using System.ComponentModel;
11 |
12 | namespace CustomControls.RJControls
13 | {
14 | public class RJToggleButton : CheckBox
15 | {
16 | //Fields
17 | private Color onBackColor = Color.MediumSlateBlue;
18 | private Color onToggleColor = Color.WhiteSmoke;
19 | private Color offBackColor = Color.Gray;
20 | private Color offToggleColor = Color.Gainsboro;
21 | private bool solidStyle = true;
22 |
23 | //Properties
24 | [Category("RJ Code Advance")]
25 | public Color OnBackColor
26 | {
27 | get
28 | {
29 | return onBackColor;
30 | }
31 |
32 | set
33 | {
34 | onBackColor = value;
35 | this.Invalidate();
36 | }
37 | }
38 |
39 | [Category("RJ Code Advance")]
40 | public Color OnToggleColor
41 | {
42 | get
43 | {
44 | return onToggleColor;
45 | }
46 |
47 | set
48 | {
49 | onToggleColor = value;
50 | this.Invalidate();
51 | }
52 | }
53 |
54 | [Category("RJ Code Advance")]
55 | public Color OffBackColor
56 | {
57 | get
58 | {
59 | return offBackColor;
60 | }
61 |
62 | set
63 | {
64 | offBackColor = value;
65 | this.Invalidate();
66 | }
67 | }
68 |
69 | [Category("RJ Code Advance")]
70 | public Color OffToggleColor
71 | {
72 | get
73 | {
74 | return offToggleColor;
75 | }
76 |
77 | set
78 | {
79 | offToggleColor = value;
80 | this.Invalidate();
81 | }
82 | }
83 |
84 | [Browsable(false)]
85 | public override string Text
86 | {
87 | get
88 | {
89 | return base.Text;
90 | }
91 |
92 | set
93 | {
94 |
95 | }
96 | }
97 |
98 | [Category("RJ Code Advance")]
99 | [DefaultValue(true)]
100 | public bool SolidStyle
101 | {
102 | get
103 | {
104 | return solidStyle;
105 | }
106 |
107 | set
108 | {
109 | solidStyle = value;
110 | this.Invalidate();
111 | }
112 | }
113 |
114 | //Constructor
115 | public RJToggleButton()
116 | {
117 | this.MinimumSize = new Size(45, 22);
118 | }
119 |
120 | //Methods
121 | private GraphicsPath GetFigurePath()
122 | {
123 | int arcSize = this.Height - 1;
124 | Rectangle leftArc = new Rectangle(0, 0, arcSize, arcSize);
125 | Rectangle rightArc = new Rectangle(this.Width - arcSize - 2, 0, arcSize, arcSize);
126 |
127 | GraphicsPath path = new GraphicsPath();
128 | path.StartFigure();
129 | path.AddArc(leftArc, 90, 180);
130 | path.AddArc(rightArc, 270, 180);
131 | path.CloseFigure();
132 |
133 | return path;
134 | }
135 |
136 | protected override void OnPaint(PaintEventArgs pevent)
137 | {
138 | int toggleSize = this.Height - 5;
139 | pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
140 | pevent.Graphics.Clear(this.Parent.BackColor);
141 |
142 | if (this.Checked) //ON
143 | {
144 | //Draw the control surface
145 | if (solidStyle)
146 | pevent.Graphics.FillPath(new SolidBrush(onBackColor), GetFigurePath());
147 | else pevent.Graphics.DrawPath(new Pen(onBackColor,2), GetFigurePath());
148 | //Draw the toggle
149 | pevent.Graphics.FillEllipse(new SolidBrush(onToggleColor),
150 | new Rectangle(this.Width - this.Height + 1, 2, toggleSize, toggleSize));
151 | }
152 | else //OFF
153 | {
154 | //Draw the control surface
155 | if(solidStyle)
156 | pevent.Graphics.FillPath(new SolidBrush(offBackColor), GetFigurePath());
157 | else pevent.Graphics.DrawPath(new Pen(offBackColor, 2), GetFigurePath());
158 | //Draw the toggle
159 | pevent.Graphics.FillEllipse(new SolidBrush(offToggleColor),
160 | new Rectangle(2, 2, toggleSize, toggleSize));
161 | }
162 | }
163 | }
164 | }
165 |
--------------------------------------------------------------------------------
/CustomControls/Resources/calendarDark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RJCodeAdvance/RJControls/36452cc0f041bbd5657d9cfa1b8d51fdb65e2cf1/CustomControls/Resources/calendarDark.png
--------------------------------------------------------------------------------
/CustomControls/Resources/calendarWhite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RJCodeAdvance/RJControls/36452cc0f041bbd5657d9cfa1b8d51fdb65e2cf1/CustomControls/Resources/calendarWhite.png
--------------------------------------------------------------------------------
/CustomControls/bin/Debug/CustomControls.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RJCodeAdvance/RJControls/36452cc0f041bbd5657d9cfa1b8d51fdb65e2cf1/CustomControls/bin/Debug/CustomControls.exe
--------------------------------------------------------------------------------
/CustomControls/bin/Debug/CustomControls.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CustomControls/bin/Debug/CustomControls.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RJCodeAdvance/RJControls/36452cc0f041bbd5657d9cfa1b8d51fdb65e2cf1/CustomControls/bin/Debug/CustomControls.pdb
--------------------------------------------------------------------------------
/CustomControls/bin/Debug/CustomControls.vshost.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RJCodeAdvance/RJControls/36452cc0f041bbd5657d9cfa1b8d51fdb65e2cf1/CustomControls/bin/Debug/CustomControls.vshost.exe
--------------------------------------------------------------------------------
/CustomControls/bin/Debug/CustomControls.vshost.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CustomControls/bin/Debug/CustomControls.vshost.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/CustomControls/bin/Debug/FontAwesome.Sharp.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RJCodeAdvance/RJControls/36452cc0f041bbd5657d9cfa1b8d51fdb65e2cf1/CustomControls/bin/Debug/FontAwesome.Sharp.dll
--------------------------------------------------------------------------------
/CustomControls/obj/Debug/CustomControls.csproj.AssemblyReference.cache:
--------------------------------------------------------------------------------
1 | MBRSC
--------------------------------------------------------------------------------
/CustomControls/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 RJ Code Advance
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # RJControls
2 | Modern, flat, and elegant Custom Controls for Windows Forms, C#, or Visual Basic.NET. This Custon Controls library was created for educational purposes through tutorial videos. You can download the source code from the repository and modify it in your own way.
3 |
4 |
VIDEO TUTORIALS:
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/RJControlsIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RJCodeAdvance/RJControls/36452cc0f041bbd5657d9cfa1b8d51fdb65e2cf1/RJControlsIcon.png
--------------------------------------------------------------------------------