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
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
WINDEV, WINDEV Mobile and WEBDEV allow you to manipulate a Check Box control programmatically. 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:
  • direct assignment:
    <Check Box control>[Option index] = 1

    <Check Box control>[Option index] = True
  • property Value:
    <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:
  • 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 field is associated with an item in a data file, assignment is automatically performed using:
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 field is associated with an item in a data file, the value entered is automatically retrieved using the <Page>.ToFile function.. 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 specific to programmable Check Box control.
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 Check box controls, see Check Box control properties.
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help