Created
December 5, 2013 15:17
-
-
Save odalet/7807040 to your computer and use it in GitHub Desktop.
dockpanelsuite 3.0 VS2012 Style: adding upper-case top-level menu items to the demo app.
This code should be added to DockSample\VS2012ToolStripRenderer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Gets or sets a value indicating whether top-level menu items should be rendered upper case or not. | |
/// </summary> | |
/// <remarks> | |
/// Setting this property to <c>true</c> helps in simulating a VS2012/2013 style. | |
/// </remarks> | |
public bool EnableUpperTopLevelCaseMenuItems { get; set; } | |
protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e) | |
{ | |
// Let's select top-level menu items | |
if (EnableUpperTopLevelCaseMenuItems && | |
e.Item is ToolStripMenuItem && | |
e.Item.GetCurrentParent() is MenuStrip) | |
e.Text = e.Text.ToUpper(); | |
base.OnRenderItemText(e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment