How to: Define a Toolbar Class
If you want to create a toolbar that contains buttons not already found on existing toolbars, you can do so by defining a custom toolbar class. Visual FoxPro provides a Toolbar base class from which you can create the class you need.
After defining a toolbar class, you can add objects to the toolbar class, and then define the properties, events, and methods for the custom toolbar. Finally, you can add the toolbar to a form set.
To define a custom toolbar class
From the Project Manager Window, select Classes and then choose New.
In the Class Name box, type the name of your class.
From the Based On box, select Toolbar to use the Toolbar base class.
-or-
Choose the dialog button to choose another toolbar class.
For example, you could store a printing class based on the Toolbar base class in an inventory library.
When you complete the New Class Dialog Box, the Class Designer appears.
You can also define a toolbar class by doing one of the following:
Choosing New from the File menu and then choosing Class.
Using the CREATE CLASS Command or MODIFY CLASS Command.
Defining the class programmatically with the DEFINE CLASS Command.
While designing a custom toolbar, you can set its properties. For example, you can set the Movable Property to allow the user to move the toolbar.
Additionally, you can use methods and events to control custom toolbars. For example, you can use the Dock Method to dock or float a toolbar, and you can use the BeforeDock Event and AfterDock Event to control what happens before and after a toolbar is docked.
See Also
Tasks
How to: Add Objects to a Custom Toolbar Class
Reference
Customize Toolbar Dialog Box (Visual FoxPro)