* Merge winforms framework content to working branch (#14) * Breadcrumb / TOC / Move net5 to net folder (#15) * change path from net5 to net * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Add .net 5 winforms placeholder article (#16) * added some metadata and adjusted net5 placeholder * corrections * corrections * corrections * Test1 * Swapping landing page vs concept * fix links * Fix links * Fix desc
2.7 KiB
title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
| title | ms.date | dev_langs | helpviewer_keywords | ms.assetid | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| How to: Set the ToolStrip Renderer for an Application | 03/30/2017 |
|
|
46acef3e-9844-4ae8-9a2e-3006fe99cadf |
How to: Set the ToolStrip Renderer for an Application
You can customize the appearance of your xref:System.Windows.Forms.ToolStrip controls individually or for all the xref:System.Windows.Forms.ToolStrip controls in your application.
Example
The following code example demonstrates how to selectively apply a custom renderer to a xref:System.Windows.Forms.ToolStrip control and a xref:System.Windows.Forms.MenuStrip control.
To use this code example, compile and run the application, and then select the scope of the custom rending from the xref:System.Windows.Forms.ComboBox control. Click Apply to set the renderer.
To see custom menu item rendering, select the xref:System.Windows.Forms.MenuStrip option from the xref:System.Windows.Forms.ComboBox control, click Apply, and then open the File menu item.
[!code-csharpSystem.Windows.Forms.ToolStrip.Misc#1]
[!code-vbSystem.Windows.Forms.ToolStrip.Misc#1]
[!code-csharpSystem.Windows.Forms.ToolStrip.Misc#70]
[!code-vbSystem.Windows.Forms.ToolStrip.Misc#70]
Set the xref:System.Windows.Forms.ToolStripManager.Renderer%2A?displayProperty=nameWithType property to apply a custom renderer to all the xref:System.Windows.Forms.ToolStrip controls in your application.
Set the xref:System.Windows.Forms.ToolStrip.Renderer%2A?displayProperty=nameWithType property to apply a custom renderer to an individual xref:System.Windows.Forms.ToolStrip control.
Compiling the Code
This example requires:
- References to the System.Design, System.Drawing, and System.Windows.Forms assemblies.