In the basic course of VFP-check box, the Common Properties of check box controls have been given. The focus of this control is on the judgment of its Value property values, in addition to the ControlSource property to bind it to a logical field in the table, and to program in events such as Click, Interactivechange, and so on that it supports.
This article is a small example of programming in the Interactivechange event of a check box control, which controls the text size and color changes of the label control by selecting the check box at run time, which runs the following interface:
Production steps:
Create a new form, set its Caption property value to programming Getting Started-check box control, and Save as a check box control. Scx.
Two, add a Label control to the form, the Caption property value is set to programming getting started, and the FontSize property value set to the 10,autosize property value set to. T.,forecolor property value set to "0,0,255" (RGB color)
Add two check box controls to the form, set the Caption property value to "Increase font size" and "Change Color", and other property values by default.
Iv. Add event code:
1. Interactivechange Event for check box Check1 ("Increase Font size"):
If this.value=1
thisform.label1.fontsize=18
else
thisform.label1.fontsize=10
endif
2. Interactivechange Event for check box Check2 ("Change Color"):
If this.value=1
Thisform.label1.forecolor=rgb (255,0,0)
else
Thisform.label1.forecolor=rgb (0,0,255)
endif
Run the check box control. Scx ".
This example is relatively simple, the code in the win2003+vfp6.0 environment debugging pass.
See the full set of "rookie also learn VFP" tutorial