ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Check Box control
  • 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
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
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
WEBDEV - Server codePHP

In WEBDEV

To retrieve the value of an option, you can use:
  • the direct assignment.
    <Option_Value> = <Check Box control>[Option index]
  • the Value property.
    <Option_Value> = <Check Box control>[Option index].Value
In this case, <Option_Value> is a boolean set to:
  • True (1) if the box is checked,
  • False (0) if the box is unchecked.
Remark: If the control is bound to a data file item, the value entered in the control is automatically updated in the data source using PageToFile. For more details, see Linking a Check Box control to an item.
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.
BackgroundColorGets and sets the background color of the Check Box control.
CaptionGets and sets the caption of Check Box control or the caption of an option in the Check Box control.
ColorGets and sets the color of options in the Check Box control.
CountGets the number of options in a Check Box control.
HeightGets and sets the option height (for the Check Box controls that are using a display mode with an image and/or a sub-caption).
HorizontalAlignmentGets and sets the horizontal alignment of a control.
ImageGets and sets the image associated with an option (if the Check Box control uses a display mode with an image).
InitialValueGets the initial value of a Check Box control.
NumberColumnGets the number of columns in the Check Box control.
SubCaptionGets and sets the sub-caption of an option (if the Check Box control uses a display mode with sub-captions).
TriStateAllows you to manage the three states of an option in a Check Box control (checked, unchecked, undefined).
VerticalAlignmentGets 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.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help