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
|
/// <summary>
/// Custom color class to overwrite the professional color table
/// and "disable" the border around disabled menu items.
/// </summary>
public class WhidbeyColorTable : ProfessionalColorTable
{
/// <summary>
/// Overwrite the MenuItemBorder property to
/// disable the border around disabled items.
/// </summary>
public override Color MenuItemBorder
{
get
{
return Color.Transparent;
}
}
}
// --------------------
// Initializing...
// --------------------
// Create a new instance of the custom color table
ProfessionalColorTable whidbeyColorTable = new WhidbeyColorTable();
// Enable system colors to a "whidbey" look and feel
whidbeyColorTable.UseSystemColors = true;
// Now render the main menu strip using the new colored render
menuStrip.Renderer = new ToolStripProfessionalRenderer(whidbeyColorTable);
|