Share via


How to: View Class Definition Code

You can view the code for class definitions, specific parameters, or parent class code for user-defined methods using the Class Browser. You can also save class definition code to another class library.

To view class definition code

  1. In the Class Browser, open the class library you want.

    For information about opening the Class Browser, see How to: Run the Class Browser.

  2. In the class list, select the class you want.

  3. In the Class Browser, click the View Class Code button.

Visual FoxPro displays definition code for the class in a read-only program (.prg) file. The class definition displayed includes all property settings and method and event code.

Note

The code is displayed for viewing purposes only. In many cases, you can save it to a program and run it directly; however, code with nested containers generate errors. To view type library information, use the Object Browser Window.

You can use a limited selection of editing commands, such as Find, Copy, and Select All, on the Edit menu.

If parent class code is available for a user-defined method, you can view the parent class code.

To view parent class code for a user-defined method

  1. In the Class Browser, double-click a class or class member.

    The class or class member opens in the Class Designer or Form Designer. If no code window is open, on the View menu, choose Code.

  2. On the Visual FoxPro toolbar, click the Edit ParentClass Method button.

See Also

Tasks

How to: View Class Hierarchies

How to: Filter the Class Browser Class List

Reference

Class Browser Window

Other Resources

Operating the Class Browser

Managing Classes and Class Libraries