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. ;)
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.
- 27th February, 2008: Initial version
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.