Defining 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, 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.
In the StoreIn box, type the name of the library in which you want to save the new class.
-or-
Choose the dialog button to select an existing library.
Add objects to the new 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 or MODIFY CLASS command.
- Defining the class programmatically with the DEFINE CLASS command.
See Also
Adding Objects to a Custom Toolbar Class | Creating Custom Toolbars | Customize Toolbar Dialog Box | Designing Menus and Toolbars | Customizing the Visual FoxPro Environment