How to: Add a Coordinated Toolbar and Menu to a Form Set
When you have created a toolbar class and a menu that are designed to work together, it is easy to incorporate them in a form set.
To incorporate a coordinated toolbar and menu in a form set
Add the toolbar to the form set in one of three ways:
Drag the toolbar class from the Project Manager Window into the Form Designer.
Register the toolbar class library and add the toolbar to the form set from the Form Controls toolbar.
In the Init Event of the form set, include code with the AddObject Method to add the toolbar.
In the Load Event of the form set, save the existing menu and run your menu program.
For example, if your menu name is mymenu, include the following lines of code using the PUSH MENU Command and DO Command:
PUSH MENU _MSYSMENU DO mymenu.mpr
In the Unload event of the form set, restore the original menu with the POP MENU Command:
POP MENU _MSYSMENU
If some menu commands are used more than others, you can create custom toolbars containing buttons for those commands. Then, users can simply press the buttons whenever they need the commands. However, if you create a toolbar, you should synchronize the menu commands with their corresponding buttons. For example, if you enable a button, you should enable its corresponding menu command.
See Also
Tasks
How to: Create the Coordinated Menu
How to: Test and Debug a Menu System
Reference
Customize Toolbar Dialog Box (Visual FoxPro)