Privacy Policy
Best viewed with:

☕ Buy me a coffee
Mick Dohertys' .net Tips and Tricks - Tips / Menu
Adding Menu Items to the Window Menu(AKA System Menu).

There is no DotNet Native way to manipulate the Window Menu. You must do it all via InterOp.
You can add existing Menuitems though.

  • VB Code
  • C# Code

The instructions shown here detail the steps necessary to achieve the menu as shown above.


Create an Extender Component to add a Tag property to MenuItems.

This Class has been updated to add a RadioGroup property so that MenuItems can act like RadioButtons without the need for any code.

  • VB Code
  • C# Code

Add a new component to your project with this code.


Office style Menu.

A complete ownerdraw menu class with RightToLeft support. Add this class to your project and after designing the layout of your standard menu, use search and replace to replace 'System.Windows.Forms.MenuItem' with 'MenuItemEx'. You will then be able to assign colors and icons to each menu item in the project. Use this class for MDI projects or download the MenuSkinner component in the Controls section. The MenuSkinner is much simpler to use but there is a problem with Menus that unMerge which I have yet to find a solution for.

  • VB Code
  • C# Code

Warning! There's a lot of code here.


Custom Shortcut.

Take a look at the File-Exit MenuItem in Visual Studio and you will see that it has the shortcut Alt+Q.
Now try to set that to your Exit MenuItem and you'll find that it's not in the Shortcut Enum.
Not to worry, this is very easily overcome by following the instructions below.

  • VB Code
  • C# Code


Custom MenuBar color.

With OwnerDraw you can manipulate the colors of a MenuItem, but not the MenuBar itself.
This task can be easily achieved with a little InterOp.

  • VB Code
  • C# Code