How to: Define Toolbar Actions
After creating a toolbar, you must define the actions associated with the toolbar and its objects. For example, you must define what happens when the user clicks the toolbar or one of its buttons.
To define a toolbar action
Select the object for which you want to define an action: the toolbar or one of its buttons.
In the Properties Window (Visual FoxPro), choose the Methods tab.
Edit the appropriate event.
Add the code that specifies the action.
Additionally, you can set properties and methods of the toolbar and its objects.
Coordinating Menus and Custom Toolbars
If you create a toolbar, you should synchronize menu commands with their corresponding toolbar buttons. For example, if you enable a toolbar button, you should enable its corresponding menu command.
You should design and create your application to:
Perform the same actions when the user chooses associated toolbar buttons and menu items.
Coordinate the enabling and disabling of associated toolbar buttons and menu items.
To coordinate menu items and toolbar buttons
Create a toolbar by defining a toolbar class, add command buttons, and include the operational code in the methods associated with the Click Event of the command buttons.
Create the coordinated menu.
Add the coordinated toolbar and menu to a form set.
See Also
Tasks
How to: Coordinate Toolbars and Forms Using Code
How to: Create the Coordinated Menu
Reference
Customize Toolbar Dialog Box (Visual FoxPro)