1. attributes are the object data
Used to indicate the object status. property has a property value. Changing the property value of an object changes the object state. you can select a control in the \ "Form Designer \" window at design time and set its attribute values in the \ "properties \" window; it can also be completed by the program code at runtime. The syntax format is as follows:
Format: object reference. attribute name
For example, the following program code sets some attributes of the text1 text box in the current form.
Thisform. text1.enabled =. T. & the text box is valid.
Thisform. text1.forecolor = RGB (0, 0) & text color set to black
2. Set multiple attributes consecutively
Using the with --- endwith statement, you can set multiple attributes for the object at a time. The with structure is as follows:
Format:
With object
Statement Block
Endwith
Note: using the with structure, you can assign multiple attributes to an object at the same time without repeatedly specifying the object name. for example, to set multiple attributes for text1 in the current form and assign values using the with structure, the Code is as follows:
With thisform. text1
. Width = 10 & set the width to 10
. Enabled =. T.
. Forecolor = RGB (0, 0, 0)
Endwith
Note: In the statement block in the middle, the solid dots before each attribute name (such as width) cannot be missing.
Iii. common attributes of VFP objects are shown in the following table:
Iv. Object methods:
The object method determines the operation to be performed on the object, which is invisible in the code of the method. You can call the method to use the object. The reference format of the object method is as follows:
Format: object reference. Method Name
For example, call the thisform. Release Method to release the current form. For example, the call statement for activating and displaying the defined form student is as follows :?
Student. Show ()
The show () statement is the method program called by the form. When this method is executed, it is activated in the main VFP window and the form object is displayed.
Common VFP object methods are as follows:
MoreDatabase tutorialKnowledge can be logged on to e liangshi Yiyou.
A brief understanding of VFP object attributes and Methods