)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to change the appearance of the ToolStripEx control?

Platform: WinForms |
Control: RibbonControlAdv |
Published Date: April 30, 2011 |
Last Revised Date: February 4, 2020

Appearance of the ToolStripEx

The appearance of the ToolStripEx can be customized by the following steps.

1. Create the ColorTable for customization.

2. Apply the ColorTable value to the CustomRenderer class.

3. Then, proceed to assign the Custom Render class to the ToolStripEx renderer.

To create custom Color Table:

By creating the custom Color Table, you can assign the required color to the Custom Render class. Here, CustomOffice12Colors class is initialized for this purpose.

To apply ColorTable to the Custom Renderer class:

Create a custom renderer class with the required ColorTable value applied to it. Here, the Office12ToolStripRenderer class is initialized for this purpose.

To assign the Custom render class to the ToolStripEx:

The Renderer property in the ToolStripEx helps to apply the custom renderer.

C#

// Initializes the custom color table.
CustomOffice12Colors customColors = new CustomOffice12Colors();
//Creates renderer with the custom color table.
Syncfusion.Windows.Forms.Tools.Office12ToolStripRenderer renderer = new Syncfusion.Windows.Forms.Tools.Office12ToolStripRenderer(customColors);
// Applies the custom renderer to the ToolStripEx to customize the appearance.
this.toolStripEx1.Renderer = renderer;
//Creates the Custom color table.
public class CustomOffice12Colors : Syncfusion.Windows.Forms.Tools.Office12ColorTable
{
    //Overrides the CaptionGradientBegin.
    public override Color CaptionGradientBegin
    {
        get
        {
            return Color.Gold;
        }
    }
    //Overrides the CaptionGradientEnd.
    public override Color CaptionGradientEnd
    {
        get
        {
            return Color.Goldenrod;
        }
    }
    //Overrides the ToolStripGradientBegin.
    public override Color ToolStripGradientBegin
    {
        get
        {
            return Color.LightPink;
        }
    }
    //Overrides the ToolStripGradientEnd.
    public override Color ToolStripGradientEnd
    {
        get
        {
            return Color.LightGray;
        }
    }
}

VB

'Initializes the custom color table.
Dim customColors As New CustomOffice12Colors()
'Creates the renderer with the custom color table.
Dim renderer As New Syncfusion.Windows.Forms.Tools.Office12ToolStripRenderer(customColors)
Applies the custom renderer to the ToolStripEx to customize the appearance.
Me.toolStripEx1.Renderer = renderer
'Creates the Custom color table.
Public Class CustomOffice12Colors
    Inherits Syncfusion.Windows.Forms.Tools.Office12ColorTable
    'Overrides the CaptionGradientBegin.
    Public Overrides ReadOnly Property CaptionGradientBegin() As Color
        Get
  Return Color.Gold
        End Get
    End Property
    'Overrides the CaptionGradientEnd.
    Public Overrides ReadOnly Property CaptionGradientEnd() As Color
        Get
  Return Color.Goldenrod
        End Get
    End Property
    'Overrides the ToolStripGradientBegin.
    Public Overrides ReadOnly Property ToolStripGradientBegin() As Color
        Get
  Return Color.LightPink
        End Get
    End Property
    'Overrides the ToolStripGradientEnd.
    Public Overrides ReadOnly Property ToolStripGradientEnd() As Color
        Get
  Return Color.LightGray
        End Get
    End Property
End Class

 

Note:

The appearance of the ToolStripEx can be changed by using the “VisualStyle” property.

 

Default color scheme of the ToolStripEx

Figure 1: Default Color scheme of the ToolStripEx

ToolStripEx is specified with the Metro style

Figure 2: ToolStripEx is specified with the Metro Style

Custom color is specified for ToolStripEx

Figure 3: Custom color is specified for ToolStripEx

Samples:

C#: ToolStripEx_CustomColor_C#

VB: ToolStripEx_CustomColor_VB

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon