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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize the MainMenu ToolBar in the WinForms MainFrameBarManager?

Platform: WinForms |
Control: MainFrameBarManager

Customize the MainFrameBarManager

In the MainFrameBarManager, the background of the MainManu ToolBar can be customized by handling the DrawBackground event. The following code example demonstrates the same.


//Draws the background of the MainMenu ToolBar.
this.mainFrameBarManager1.MainMenuBar.DrawBackground += new PaintEventHandler(MainMenuBar_DrawBackground);
void MainMenuBar_DrawBackground(object sender, PaintEventArgs e)
    //Gets the MainframeBarManager items bound.
    Rectangle rect = e.ClipRectangle;
    //Fills the rectangle.
    e.Graphics.FillRectangle(Brushes.Pink, rect); 


'Draws the background of the MainMenu ToolBar.
AddHandler mainFrameBarManager1.MainMenuBar.DrawBackground, AddressOf MainMenuBar_DrawBackground
Private Sub MainMenuBar_DrawBackground(ByVal sender As Object, ByVal e As PaintEventArgs)
 'Gets the MainframeBarManager items bound.
 Dim rect As Rectangle = e.ClipRectangle
 'Fills the rectangle.
 e.Graphics.FillRectangle(Brushes.Pink, rect)
End Sub



The above solution is not applicable for Default, OfficeXP and Metro visual style in the MainFrameBarManager.


The following screenshot displays the Customized MainFrameBar Manager.

Customize the MainFrameBar manager

Figure 1: Customized MainFrameBar Manager

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/MainFrameManager_VB1582033944.zip

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
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