Permalink
Fetching contributors…
Cannot retrieve contributors at this time
46 lines (39 sloc) 2.41 KB
title ms.custom ms.date ms.prod ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
How to: Customize Colors in ToolStrip Applications
03/30/2017
.net-framework
dotnet-winforms
article
jsharp
toolbars [Windows Forms], customizing colors
colors, customizing in ToolStrip controls [Windows Forms]
ToolStrip control [Windows Forms], custom colors
e2752fe2-1afb-489e-ab96-b7805acd96bc
9
dotnet-bot
dotnetcontent
wpickett

How to: Customize Colors in ToolStrip Applications

You can customize the appearance of your xref:System.Windows.Forms.ToolStrip by using the xref:System.Windows.Forms.ToolStripProfessionalRenderer class to use customized colors.

Example

The following code example demonstrates how to use a xref:System.Windows.Forms.ToolStripProfessionalRenderer to define custom colors at run time.

[!code-csharpSystem.Windows.Forms.ToolStrip.Misc#20] [!code-vbSystem.Windows.Forms.ToolStrip.Misc#20]

Compiling the Code

This example requires:

  • References to the System.Design, System.Drawing, and System.Windows.Forms assemblies.

For information about building this example from the command line for [!INCLUDEvbprvb] or [!INCLUDEcsprcs], see Building from the Command Line or Command-line Building With csc.exe. You can also build this example in [!INCLUDEvsprvs] by pasting the code into a new project. Also see How to: Compile and Run a Complete Windows Forms Code Example Using Visual Studio.

See Also

xref:System.Windows.Forms.ToolStripManager
xref:System.Windows.Forms.ProfessionalColorTable
xref:System.Windows.Forms.MenuStrip
xref:System.Windows.Forms.ToolStrip
xref:System.Windows.Forms.ToolStripProfessionalRenderer