次の方法で共有


THISFORM Object Reference

Provides a reference to the current form in form event code or in a class definition.

THISFORM.PropertyName | ObjectName

Parameters

  • PropertyName
    Specifies a property for the form.

  • ObjectName
    Specifies an object in the form.

Remarks

THISFORM provides a convenient way of referring to the current form when writing event-handling programs in a form. For example, this Click Event program for a command button sets the button's caption to the current time:

thisform.command1.caption = time()

Using THISFORM instead of explicitly referring to the current form by name (for example, form1.command1.caption) makes program code portable between forms.

When creating class definitions, THISFORM also provides a means of referring to the current form within a method. THISFORM lets you reference an object on the form or property without using multiple Parent properties.

See Also

Reference

THIS Object Reference

THISFORMSET Object Reference

Click Event

Other Resources

Objects, Collections, and Classes

Language Reference (Visual FoxPro)