|
|
|
|
- Overview
- Initializing the different options of a Check Box control
- Retrieving the value of an option of a Check Box control
- In WEBDEV
- Modifying the caption characteristics
- Properties specific to Check Box controls
Handling a Check Box control through programming
WINDEV, WINDEV Mobile and WEBDEV allow you to handle a Check Box control through programming. To do so, use the variable of the Check Box control in the code. The variable of the Check Box control corresponds to the name of the Check Box control. This variable is an integer. Initializing the different options of a Check Box control By default, no option is checked when a Check Box control is displayed. To check an option of a Check Box control, you can use: - the direct assignment:
<Check Box control>[Option index] = 1
<Check Box control>[Option index] = True - the Value property:
<Check Box control>[Option index].Value = True
<Check Box control>[Option index].Value = 1 To clear an option of a Check Box control control, you can use: - the direct assignment:
<Check Box control>[Option index] = 0
<Check Box control>[Option index] = False - the Value property.
<Check Box control>[Option index].Value = 0
<Check Box control>[Option index].Value = False Remark: If the control is associated with a data file item, the assignment is automatically performed via: Retrieving the value of an option of a Check Box control Modifying the caption characteristics The Caption property allows you to: - change the caption of the Check Box control:
<Check Box control>.Caption = <Control caption> - change the caption for all the options of the Check Box control:
The options must be separated by the TAB character. You can specify the first options only.
<Check Box control>.Caption = <Option 1> + TAB + <Option 2> + TAB + <Option 3> ... - change the caption of an option:
<Check Box control>[Option index].Caption = <New option caption> - retrieve the caption of an option:
<Option caption> = <Check Box control>[Option index].Caption
Properties specific to Check Box controls The following properties are used to manage the characteristics of a Check Box control by programming. | | BackgroundColor | Gets and sets the background color of the Check Box control. | Caption | Gets and sets the caption of Check Box control or the caption of an option in the Check Box control. | Color | Gets and sets the color of options in the Check Box control. | Count | Gets the number of options in a Check Box control. | Height | Gets and sets the option height (for the Check Box controls that are using a display mode with an image and/or a sub-caption). | HorizontalAlignment | Gets and sets the horizontal alignment of a control. | Image | Gets and sets the image associated with an option (if the Check Box control uses a display mode with an image). | InitialValue | Gets the initial value of a Check Box control. | NumberColumn | Gets the number of columns in the Check Box control. | SubCaption | Gets and sets the sub-caption of an option (if the Check Box control uses a display mode with sub-captions). | TriState | Allows you to manage the three states of an option in a Check Box control (checked, unchecked, undefined). | VerticalAlignment | Gets and sets the vertical alignment of a control. |
For a complete list of WLanguage properties that can be used with a Check box control, see Properties associated with a Check Box control.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|