Click here to Skip to main content
Click here to Skip to main content

Replacing MainMenu Controls With VS2005 MenuStrip Controls

By , 27 Feb 2008
 

Introduction

If you (like us) have VS2003 code that uses MainMenu controls you would have noticed how forms grow by themselves when opened in the VS2005 designer, and may have also decided that it is time to upgrade to the newer MenuStrip control - as Microsoft is obviously hinting should be done. Doing each form by hand will be a tedious and time-consuming process if you have many forms with MainMenus on (we have 283).

Time for a quick program...

Using the code

This is a very "quick and dirty" little program that will do the replacement for you if there are many forms that have MainMenu controls. It is written in VB for VB.NET code, so anyone using C# will need to translate it for C# syntax.

Use at your own peril, and remember to make a backup before running it ;)

Known issues

The code will set the shortcut key of menu items - this will work in runtime, but if your code uses the System.Windows.Forms.Shortcut enum this will need to be changed to use the Windows.Forms.Keys enum to open the form in the designer.

Points of Interest

This CodeProject Article: UpgradeToMenuStrip.aspx by Jim Hollenhorst details what needs to be done manually - this project doesn't do everything recommended in it, but should act as a good starting point for anyone with many forms that need to be fixed.

History

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Bryan Symons
Software Developer (Senior) SDT
South Africa South Africa
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 27 Feb 2008
Article Copyright 2008 by Bryan Symons
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid