Share via


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

  1. Add the toolbar to the form set in one of three ways:

  2. 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
    
  3. 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)

Other Resources

Creating Custom Toolbars

Designing Menus and Toolbars

Customizing the Visual FoxPro Environment