PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Overview
  • Initializing the different options of a Check Box control
  • Retrieving the value of an option of a Check Box control
  • In WINDEV and WINDEV Mobile
  • In WEBDEV
  • Modifying the colors of a Check Box control row by row
  • In WINDEV and WINDEV Mobile
  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
WINDEV, WINDEV Mobile and WEBDEV allow you to handle a Check Box control by 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 Check Box control. This variable is an integer.
WINDEVAndroidiPhone/iPad Remark: Several WLanguage functions are used to add, insert or delete options in a Check Box control. For more details, see Functions for managing Check Box controls.
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:
    <Name of Check Box control>[Option subscript] = 1

    <Name of Check Box control>[Option subscript] = True
  • the property ..Value:
    <Name of Check Box control>[Option subscript]..Value = True


    <Name of Check Box control>[Option subscript]..Value = 1
To clear an option of a Check Box control control, you can use:
  • the direct assignment:
    <Name of Check Box control>[Option subscript] = 0

    <Name of Check Box control>[Option subscript] = False
  • the property ..Value.
    <Name of Check Box control>[Option subscript]..Value = 0

    <Name of Check Box control>[Option subscript]..Value = False
Remark: If the control is associated with a data file item, the assignment is automatically performed via:
WINDEVWindows Mobile If the undefined status of an option is supported ("Details" screen of the control description or ..TriState), the following syntax is used to initialize the option in the undefined status:

<Name of Check Box control>[Option subscript] = -1
Retrieving the value of an option of a Check Box control
WINDEVWINDEV MobileAndroidiPhone/iPadUniversal Windows 10 AppJava

In WINDEV and WINDEV Mobile

To retrieve the value of an option, use the following syntax:
<Option_Value> = <Name of Check Box control>[Option subscript]
In this case, <Option_Value> is a boolean set to:
  • True (1) if the box is checked,
  • False (0) if the box is unchecked.
  • WINDEVWindowsWindows Mobile -1 if the box is undefined (if this state is supported by the option).
Remark: If the field is associated with an Item of a data file, the retrieval of the value entered is automatically carried out using the ScreenToFile function.. See Linking a Check Box control to an item for more details.
WEBDEV - Server codePHP

In WEBDEV

To retrieve the value of an option, you can use:
  • the direct assignment.
    <Option_Value> = <Name of Check Box control>[Option subscript]
  • the property ..Value.
    <Option_Value> = <Name of Check Box control>[Option subscript]..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 associated with an item found in a data file, the entered value is automatically retrieved by using PageToFile. See Linking a Check Box control to an item for more details.
Modifying the colors of a Check Box control row by row
WINDEVWindows Mobile

In WINDEV and WINDEV Mobile

To modify the colors of a Check Box control row by row, use the following syntax:
<Name of Check Box control>..Caption = gPen(<Color of Option 1>) + <Caption of option 1> + TAB + ...
gPen(<Color of Option N>) + <Caption of Option N>
<Color of option> corresponds to:
Modifying the caption characteristics
The Property ..Caption allows to:
  • change the caption of Check Box control:
    <Name of Check Box control>..Caption = <Control caption>
  • change the caption for all options of Check Box control:
    The options must be separated by the TAB character. You have the ability to specify the first options only.
    <Name of Check Box control>..caption = <Option 1> + TAB + <Option 2> + TAB + <Option 3> ...
  • change the caption of an option:
    <Name of Check Box control>[Option subscript]..Caption = <New option caption>
  • retrieve the caption of an option:
    <Option caption> = <Name of Check Box control>[Option subscript]..Caption
WINDEViPhone/iPadWindows Mobile If the Check Box control is using a display mode with images and/or sub-captions, you can:
  • know and modify the image of the option thanks to the Property ..Image:
    <Name of Check Box control >[Option subscript]..Image = <New image>
  • know and modify the option's sub label thanks to the Property ..SubCaption:
    <Name of Check Box control >[Option subscript]..SubCaption = <New sub-caption>
  • know and modify the height of the option thanks to the Property ..Height:
    <Name of Check Box control>[Option subscript]..Height = <New height in pixels>
Properties specific to Check Box controls
The following properties are used to manage the characteristics of a Check Box control by programming.
HorizontalAlignmentAllows you to know and modify the horizontal framing of an Control.
VerticalAlignmentAllows you to know and modify the vertical framing of an Control.
ColorUsed to find out and modify the color of options in the Check Box control.
BackgroundColorUsed to find out and modify the background color of Check Box control.
HeightAllows you to find out and modify the option height (for the Check Box controls that are using a display mode with an image and/or a sub-caption).
ImageAllows you to find out and modify the image associated with an option (if the Check Box control is using a display mode with an image).
LibelléUsed to find out and modify the caption of Check Box control or the caption of an option in the Check Box control.
NumberColumnAllows to know the number of columns of the Check Box control.
OccurrenceEnables you to know the number of options present in an Check Box control.
SubCaptionAllows you to find out and modify the sub-caption of an option (if the Check Box control is using a display mode with sub-captions).
TriStateAllows to manage the three states of an Check Box control option (checked, unchecked, indifferent).
InitialValueUsed to find out the initial value of a Check Box control.

To find out the entire 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