Share via


Creating Access and Assign Methods

Enhancements to the DEFINE CLASS command and the Form and Class designers make it possible for you to create Access and Assign methods both programmatically and interactively. See DEFINE CLASS for details on the access and assign methods additions.

The Form and Class Designers

You can create access and assign methods for new properties by using the New Property item of the Form menu in the Form Designer.

To create an Access or Assign method in the Form Designer

  1. Choose New Property from the Form menu.

    The New Property dialog box is displayed.

  2. Enter the name of the property to create in the Name text box, and then select the Access Method check box or Assign Method check box (or both).

  3. Choose Add to create a property for the form, and to create Access or Assign methods for the property.

You can create access and assign methods for intrinsic properties by using the New Method item of the Form menu in the Form Designer.

To create an Access or Assign method for an intrinsic Visual FoxPro property in the Form Designer

  1. Choose New Method from the Form menu.

    The New Method dialog box is displayed.

  2. Enter the name of the intrinsic property followed with _Access or _Assign in the Name text box. For example, to create an Access method for the Left property, enter Left_Access in the Name text box.

  3. Choose Add to create an Access or Assign methods for the intrinsic property.

    Note   In the Form Designer, you can create properties with Access and Assign methods only for a form or formset. To create properties with Access and Assign methods for a control or object, use the Class Designer to create the control or object class. In the Class Designer, add properties with Access and Assign methods to the control or object, and then add the control or object class to the Form in the Form Designer.

You can create an access or assign method for a class by using the New Property item in the Class menu of the Class Designer.

To create an Access or Assign method for a class in the Class designer

  1. Choose New Property from the Class menu.

    The New Property dialog box is displayed.

  2. Enter the name of the property to create in the Name textbox, then select the Access Method check box or Assign Method check box (or both).

  3. Choose Add to create a property for the class, and to create Access or Assign methods for the property.

For more information about creating Access or Assign methods, see the New Property Dialog Box topic.

See Also

Access and Assign Methods | Calling Methods