次の方法で共有


How to: Add Classes to Visual FoxPro Tools

Typically, you can add objects to forms by dragging classes from the Toolbox or adding them from the Form Controls toolbar. However, Visual FoxPro does not add custom classes to the Toolbox or the Form Controls toolbar automatically.

To add a class to the Toolbox

  1. On the Tools menu, choose Toolbox.

  2. Right-click the Toolbox and choose Add Class Library.

  3. In the Category box in the Add Class Library dialog box, type or choose the category you want to add the class to.

  4. In the Class Library box, type the name of the class library.

    -OR-

    Click the ellipsis (...) button to select a class library.

Visual FoxPro adds the class to the end of category you chose in the Toolbox.

For more information, see Toolbox (Visual FoxPro) and How to: Customize the Toolbox.

To add a class to the Form Controls toolbar

  1. Open a form.

  2. On the View menu, choose Form Controls Toolbar.

  3. On the Form Controls toolbar, click View Classes, and then choose Add.

  4. In the Open dialog box, select a class library, and then click Open.

    The class appears on the Form Controls toolbar.

When you add class libraries to the Form Controls toolbar, they appear registered in the Controls tab of the Options dialog box. If you want the class to appear in the Forms Control toolbar in future sessions of Visual FoxPro, click Set As Default in the Controls tab of the Options dialog box.

Tip

You can register the class library so that when you choose View Classes on the Form Controls toolbar, the class library appears in the list of class libraries you can choose.

To register a class library

  1. On the Tools menu, choose Options.

  2. In the Options dialog box, choose the Controls tab.

  3. On the Controls tab, choose Visual class libraries, and then click Add.

  4. In the Open dialog box, select a class library, and then click Open.

  5. To make the class library available on the Form Controls toolbar for future sessions of Visual FoxPro, click Set As Default.

  6. Click OK.

See Also

Concepts

Working with Classes in Visual FoxPro