Compartir a través de


How to: Add Code to Methods and Events

You can add code for methods that you add to classes or class events using the Class Designer or programmatically.

To add code for a method or event

  1. Open the class in the Class Designer.

    For more information about opening classes, see How to: Modify Classes.

  2. On the Visual FoxPro toolbar, click Properties Window.

  3. In the properties list of the Properties window, double-click the method or event you want to add code for to open a code window.

    Note

    Custom methods appear at the end of the properties list.

  4. In the code window, add code for the method or event.

  5. When you are finished adding code, close the code window.

For more information, see Properties Window (Visual FoxPro) and Code Window.

To add code to methods and events programmatically

  • Use the DEFINE CLASS command and include the FUNCTION or PROCEDURE clause.

For more information, see DEFINE CLASS Command.

See Also

Concepts

Classes in Visual FoxPro

Working with Classes in Visual FoxPro

Other Resources

Understanding the Event Model