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

  1. From the Project Manager, select Classes and then choose New.

  2. In the Class Name box, type the name of your class.

  3. From the Based On box, select Toolbar to use the Toolbar base class.

    -or-

    Choose the dialog button to choose another toolbar class.

  4. 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.

  5. 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.

A new custom toolbar in the Class Designer

You can also define a toolbar class by doing one of the following:

See Also

Adding Objects to a Custom Toolbar Class | Creating Custom Toolbars | Customize Toolbar Dialog Box | Designing Menus and Toolbars | Configuring Visual FoxPro