Windows Develop Bookmark and Share   
 index > Windows Forms General > customize menustrip
 

customize menustrip

Hi,

i want to change the colors of a menustrip(VS2008).
i changed the backgroundcolor and the textcolor with the designer.
the background is black and the text is grey.
it looks nice but if i hover over the menu, the submenu pops up and the style looks like the standard style.
How can i change the colors of the menuitems too ?

bye jo
jogisarge  Friday, December 12, 2008 4:13 PM
I can't find my own posts back. Google ToolStripRenderer.
Hans Passant.
nobugz  Saturday, December 13, 2008 1:37 AM
Hi jogisarge,

nobugz is right.You can write your own renderer, and then setit asthe renderer of the menustrip.
To set the custom renderer for one ToolStrip, set the System.Windows.Forms.ToolStrip.Renderer property to the custom renderer:
toolStrip1.Renderer = new RedTextRenderer();
Or to set the custom renderer for all ToolStrip classes contained in your application: Set the System.Windows.Forms.ToolStripManager.Renderer property to the custom renderer and set the RenderMode property to ManagerRenderMode.
toolStrip1.RenderMode = ToolStripRenderMode.ManagerRenderMode;
ToolStripManager.Renderer = new RedTextRenderer();

Best regards,
Steven Yu
Steven.Yu  Monday, December 15, 2008 6:27 AM
I can't find my own posts back. Google ToolStripRenderer.
Hans Passant.
nobugz  Saturday, December 13, 2008 1:37 AM
Hi jogisarge,

nobugz is right.You can write your own renderer, and then setit asthe renderer of the menustrip.
To set the custom renderer for one ToolStrip, set the System.Windows.Forms.ToolStrip.Renderer property to the custom renderer:
toolStrip1.Renderer = new RedTextRenderer();
Or to set the custom renderer for all ToolStrip classes contained in your application: Set the System.Windows.Forms.ToolStripManager.Renderer property to the custom renderer and set the RenderMode property to ManagerRenderMode.
toolStrip1.RenderMode = ToolStripRenderMode.ManagerRenderMode;
ToolStripManager.Renderer = new RedTextRenderer();

Best regards,
Steven Yu
Steven.Yu  Monday, December 15, 2008 6:27 AM

You can use google to search for other answers

Custom Search

More Threads

• Urgent: Binding ComboBox!!!
• How do I select a textbox at runtime
• UTF-8 and Unicode
• Setting up a comment log box
• anyone have any experience with Mere Mortals.Net Application Framework or any other App Framework products?
• Loading xml Files
• why cant i make my form smaller that 148 by 40?
• How to open the right form when the application start.
• MaskedTextBox
• Adding nodes in AfterLabelEdit event handler of treeview control