Skip to content

Instantly share code, notes, and snippets.

@odalet
Created December 5, 2013 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odalet/7807040 to your computer and use it in GitHub Desktop.
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
/// <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