A brief understanding of VFP object attributes and Methods

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.