Slightly better WinForms Vista-style menus: Media::Rebar, and more!
I’ve recently refactored my WinForms NativeToolStripRenderer component: it’s now leaner and meaner, supporting some interesting vista styles, as well as right-to-left menus. Overall, it’s quite a bit better. (Thanks to windowsformsaero for improving the code somewhat).
The code is at http://code.google.com/p/szotar/source/browse/trunk/Client/Szotar.WindowsForms/Base/NativeToolStripRenderer.cs. Note that this ToolStripRenderer works fine with context menus, too.
To use this on all toolbars in your application, do the following near the start of your program:
ToolStripManager.Renderer = new ToolStripAeroRenderer(ToolbarTheme.Toolbar);
If you want different styles for different toolbars, set the renderer for that toolbar only when the form loads:
mainMenu.Renderer = contextMenu.Renderer = toolStripPanel.Renderer = new ToolStripAeroRenderer(ToolbarTheme.Toolbar);
Setting the Renderer for a ToolStripPanel should automatically render all of the contained ToolStrips in that style.
As I mentioned earlier, the renderer supports 3 new styles, which are new in Windows Vista:
- Media::Rebar - like Windows Media Player
- Communications::Rebar - like Windows Mail
- BrowserTabBar::Rebar - like Internet Explorer 7 and 8
- Help::Rebar - like Windows Help








