1
1
namespace TestForm ;
2
2
3
3
/// <summary>
4
- /// Test form to demonstrate the themed system menu functionality.
4
+ /// Test form to demonstrate the system menu functionality.
5
5
/// </summary>
6
- public partial class ThemedSystemMenuTest : KryptonForm
6
+ public partial class SystemMenuTest : KryptonForm
7
7
{
8
- public ThemedSystemMenuTest ( )
8
+ public SystemMenuTest ( )
9
9
{
10
10
InitializeComponent ( ) ;
11
11
12
12
// Set form properties
13
- Text = "Themed System Menu Test" ;
13
+ Text = "System Menu Test" ;
14
14
Size = new Size ( 600 , 400 ) ;
15
15
StartPosition = FormStartPosition . CenterScreen ;
16
16
17
- // Enable the themed system menu (enabled by default)
17
+ // Enable the system menu (enabled by default)
18
18
//UseThemedSystemMenu = true;
19
19
20
20
// Configure how the menu appears
@@ -32,14 +32,14 @@ protected override void OnLoad(EventArgs e)
32
32
kryptonCheckBox2 . Checked = SystemMenuValues . ShowOnRightClick ;
33
33
kryptonCheckBox3 . Checked = SystemMenuValues . ShowOnAltSpace ;
34
34
35
- // Demonstrate the enhanced themed system menu features
35
+ // Demonstrate the enhanced system menu features
36
36
if ( KryptonSystemMenu != null )
37
37
{
38
38
// Add a custom menu item using the new method
39
39
KryptonSystemMenu . AddCustomMenuItem ( "About This Form" , ( sender , args ) =>
40
40
{
41
- MessageBox . Show ( "This is a test form demonstrating the themed system menu functionality!" ,
42
- "About" , MessageBoxButtons . OK , MessageBoxIcon . Information ) ;
41
+ KryptonMessageBox . Show ( "This is a test form demonstrating the system menu functionality!" ,
42
+ "About" , KryptonMessageBoxButtons . OK , KryptonMessageBoxIcon . Information ) ;
43
43
} ) ;
44
44
45
45
// Add a separator
@@ -49,8 +49,8 @@ protected override void OnLoad(EventArgs e)
49
49
KryptonSystemMenu . AddCustomMenuItem ( "Refresh Menu" , ( sender , args ) =>
50
50
{
51
51
KryptonSystemMenu . Refresh ( ) ;
52
- MessageBox . Show ( "Menu refreshed! Current item count: " + KryptonSystemMenu . MenuItemCount ,
53
- "Info" , MessageBoxButtons . OK , MessageBoxIcon . Information ) ;
52
+ KryptonMessageBox . Show ( "Menu refreshed! Current item count: " + KryptonSystemMenu . MenuItemCount ,
53
+ "Info" , KryptonMessageBoxButtons . OK , KryptonMessageBoxIcon . Information ) ;
54
54
} ) ;
55
55
56
56
// Show the current menu item count and theme
@@ -69,7 +69,7 @@ private void UpdateFormTitle()
69
69
if ( KryptonSystemMenu != null )
70
70
{
71
71
var themeInfo = $ "Theme: { KryptonSystemMenu . CurrentIconTheme } ";
72
- Text = $ "Themed System Menu Test - { KryptonSystemMenu . MenuItemCount } items - { themeInfo } ";
72
+ Text = $ "System Menu Test - { KryptonSystemMenu . MenuItemCount } items - { themeInfo } ";
73
73
74
74
// Also update the theme label
75
75
UpdateThemeLabel ( ) ;
@@ -124,10 +124,10 @@ private void kryptonButton1_Click(object sender, EventArgs e)
124
124
if ( KryptonSystemMenu != null )
125
125
{
126
126
KryptonSystemMenu . ClearCustomItems ( ) ;
127
- MessageBox . Show ( "Custom items cleared! Menu restored to default." , "Info" , MessageBoxButtons . OK , MessageBoxIcon . Information ) ;
127
+ KryptonMessageBox . Show ( "Custom items cleared! Menu restored to default." , "Info" , KryptonMessageBoxButtons . OK , KryptonMessageBoxIcon . Information ) ;
128
128
129
129
// Update the title to show new item count
130
- Text = $ "Themed System Menu Test - { KryptonSystemMenu . MenuItemCount } items";
130
+ Text = $ "System Menu Test - { KryptonSystemMenu . MenuItemCount } items";
131
131
}
132
132
}
133
133
@@ -144,7 +144,7 @@ private void kryptonButton2_Click(object sender, EventArgs e)
144
144
$ "Custom Items: { string . Join ( ", " , customItems ) } \n " +
145
145
$ "Current Icon Theme: { KryptonSystemMenu . CurrentIconTheme } ";
146
146
147
- MessageBox . Show ( info , "Menu Info" , MessageBoxButtons . OK , MessageBoxIcon . Information ) ;
147
+ KryptonMessageBox . Show ( info , "Menu Info" , KryptonMessageBoxButtons . OK , KryptonMessageBoxIcon . Information ) ;
148
148
}
149
149
}
150
150
@@ -173,11 +173,11 @@ private void kryptonButton3_Click(object sender, EventArgs e)
173
173
174
174
// Update the theme label to show the new theme
175
175
kryptonLabel3 . Values . Text = $ "Current Theme: { nextTheme } (Manually Set)";
176
-
177
- MessageBox . Show ( $ "Switched to { nextTheme } theme and refreshed icons!\n " +
178
- $ "Previous theme: { currentTheme } \n " +
179
- $ "New theme: { nextTheme } ",
180
- "Theme Changed" , MessageBoxButtons . OK , MessageBoxIcon . Information ) ;
176
+
177
+ KryptonMessageBox . Show ( $ "Switched to { nextTheme } theme and refreshed icons!\n " +
178
+ $ "Previous theme: { currentTheme } \n " +
179
+ $ "New theme: { nextTheme } ",
180
+ "Theme Changed" , KryptonMessageBoxButtons . OK , KryptonMessageBoxIcon . Information ) ;
181
181
}
182
182
}
183
183
}
0 commit comments