Look at the example of VFP: check box control

Source: Internet
Author: User

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

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.