-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathFrmCustomiseFormControls.cs
More file actions
79 lines (69 loc) · 2.32 KB
/
FrmCustomiseFormControls.cs
File metadata and controls
79 lines (69 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using GeoTagNinja.Helpers;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using WinFormsDarkThemerNinja;
namespace GeoTagNinja
{
public partial class FrmCustomiseFormControls : Form
{
public FrmCustomiseFormControls()
{
InitializeComponent();
Themer.ApplyThemeToControl(
control: this,
themeStyle: HelperVariables.UserSettingUseDarkMode ?
Themer.ThemeStyle.Custom :
Themer.ThemeStyle.Default
);
}
public void SetCustomiseControl(Control control)
{
AddItem(control);
}
public void SetCustomiseControls(System.Collections.IList controls)
{
foreach (Control control in controls)
{
AddItem(control);
SetCustomiseControls(control.Controls);
}
}
public void AddItem(Control control)
{
_ = cbx_ControlItem.Items.Add(control);
}
private void cbx_ControlItem_SelectedIndexChanged(object sender, EventArgs e)
{
pgr_Main.SelectedObject = cbx_ControlItem.SelectedItem;
lbl_ControlName.Text = ((Control)cbx_ControlItem.SelectedItem).Name;
}
private void cbx_ControlItem_DropDown(object sender, EventArgs e)
{
cbx_ControlItem.FlatStyle = FlatStyle.Popup;
cbx_ControlItem.ForeColor = Color.White;
}
private void FrmCustomiseFormControls_Load(object sender, EventArgs e)
{
HelperNonStatic helperNonstatic = new();
HelperControlAndMessageBoxHandling.ReturnControlText(
control: this, senderForm: this);
IEnumerable<Control> controls = helperNonstatic.GetAllControls(control: this);
foreach (Control control in controls)
{
if (control is Label or
GroupBox or
Button or
CheckBox or
TabPage or
RadioButton
)
{
HelperControlAndMessageBoxHandling.ReturnControlText(
control: control, senderForm: this);
}
}
}
}
}