ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Check Box control
  • Overview of the Check Box control
  • Check Box control in a window or page
  • Creating a Check Box control
  • Display modes available
  • Three-state check box
  • Limitations of Check Box controls in Java
  • Limitations in Android and iOS
  • Check Box control in a report
  • Using a Check Box control
  • Check Box in a Table control
  • "Check Box" column in a Table control
  • Check Box control and data binding
  • Swap
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 of the Check Box control
A Check Box control can correspond to:
  • a control allowing the user to answer a question with Yes or No in a window or page.
  • a column of a Table control allowing the user to select one or more rows.
  • a checkbox displayed in a report.
  • an interactive checkbox displayed in a form report.
Check Box control in a window or page
In the window or page editor, a Check Box control allows the user to answer a question with Yes or No:
  • if the option is checked, the option is set to True.
  • if the option is unchecked, the option is set to False.
A Check Box can display up to 256 options. Users select the desired options. For each option, the check box returns the option status.
Example:
Example of a check box

Creating a Check Box control

To create a Check Box control:
  1. On the "Creation" tab, in the "Usual controls" group, click "Check Box".
  2. Click where the control will be created in the window or page. The control appears in the editor.
Tip: You also have the ability to create a "preset" Check Box control by expanding "Check Box". The list of available controls is displayed with the project skin template. Simply click the control you want to create in the editor.
This list proposes to create Switch controls. For more details, see Switch control.
To view the characteristics of the control, select "Description" in the context menu.
WINDEV Remark: You can use a general tooltip for the control, or a tooltip for each one of the control options ("Help" tab).
WindowsLinuxUniversal Windows 10 AppiPhone/iPad

Display modes available

WINDEV and WINDEV Mobile feature different types of Check Box controls:
  • standard check box,
  • standard check box with sub-captions,
  • check box in Vista style (an image can be used for each option),
  • check box in Vista style with sub-captions (an image can be used for each option).
LinuxUniversal Windows 10 App Check Box controls in Vista style are not available.
The different tabs of the description window allow you to configure the control:
  • The display mode of the Check Box control can be selected in the "General" tab of the control description.
  • The "Content" tab is used to enter the characteristics specific to the display mode (image, sub-caption, row height, etc.) in the different languages of the application. These elements can be modified programmatically.
  • The "Style" tab is used to define some characteristics specific to the display mode. It is possible to define:
    • the spacing between the caption and the sub-caption ("Sub-caption of options" element).
    • the position of text of options: at the top, at the bottom, ... ("Text of options" element).
    • the checkmark position: at the top, at the bottom, ... ("Checkmark border" element).
The programming mode can change according to the type of display. For more details, see Handling a check box through programming.
AndroidiPhone/iPad For iPhone/iPad and Android applications, you can create:
  • standard check boxes.
  • iPhone/iPad standard check boxes with sub-captions.
  • native check boxes. In this case, the check box will use the iOS or Android style. To get a native check box, check "Native check box" in the "Details" tab of the control description window.
WindowsLinuxUniversal Windows 10 App

Three-state check box

In the window editor, you can enable three-state options for Check Box controls.
Three-state check box
At runtime, clicking an unchecked option will check it, and a second click on this option will give it an undefined value. In this case, the option returns -1.
To enable three-state options in a Check Box control:
  • check the corresponding option in the "Details" tab of the Check Box control description. All the options of the check box will support the three states.
  • through programming, use the TriState property on one of the check box options. This option will support three states.
Java

Limitations of Check Box controls in Java

The following characteristics are not supported in Java:
  • three-state check box.
  • proportional columns (if the options of the check box are displayed in several columns).
  • multiline check box options.
  • text of the check box options with formatting (R. T. F.).
  • help number associated with each option of the check box.
  • different display modes of the check box. Only the standard check box is available.
AndroidiPhone/iPad

Limitations in Android and iOS

Only images are supported for option checkmarks. If no image is specified, the system image is used. The elements "Checkmark" and "Checkmark border", in the style tab of the Check Box controls, are ignored.
Check Box control in a report
WINDEVWEBDEV - Server codeiPhone/iPad In the report editor, the Check Box control corresponds to a box to check:
  • If the control value is set to True, the box is checked:
  • If the control value is set to False, the box is unchecked:
Two types of Check Box controls are available in the report editor:
  • Standard Check Box control, which is simply displayed in the report.
  • Interactive Check Box control, that can be selected / cleared by the user. This control can be used in:
    • WINDEV the report viewer,
    • the generated PDF files.
To create a Check Box control:
  • Method 1: Create a standard Check Box control:
    1. On the "Creation" tab, in the "Visual" group, click "Check Box".
    2. Click where the control will be created in the report. The control appears in the editor.
  • Method 2: Create an interactive Check Box control:
    1. On the "Creation" tab, in the "Interactions" group, click "Check Box".
    2. Click where the control will be created in the report. The control appears in the editor.
To view the characteristics of the control, select "Description" in the context menu.
Remark: You can directly change the type of a Check Box control:
  1. Open the control description window.
  2. In the "UI" tab, select or deselect "Interactive (form reports)".
  3. Validate.
WINDEVWEBDEV - Server codeiPhone/iPad

Using a Check Box control

The Wingdings font must be installed on end users' computers so that the Check Box control is displayed properly.
Check Box in a Table control
WINDEVWEBDEV - Server codeJava

"Check Box" column in a Table control

To allow the check box to be checked (or not) when clicking the "Check Box" column:
  1. The Table control must be in edit.
  2. The "Check Box" column must be in edit mode.
  3. All other columns of the Table control must be read-only.
Using a Check Box column in a Table control:
The following behavior can occur when using a Check Box column in a Table control based on a data file:
  • The check boxes of visible rows are checked.
  • Each time the scrollbar of the Table control moves, the check boxes are automatically unchecked.
This behavior indicates that the check box is not linked to a file item.
To use a check box in a Table control, you must:
  • create a suitable item (e.g., a check box item) in your data file. In this case, this item can be managed in a Table control based on a data file.
  • create a Table control populated programmatically.
Check Box control and data binding
Check Box controls can use data binding under the following conditions:
  • if the Check Box control has a single option, it must be linked to a simple variable
  • if the Check Box control has several options, it must be linked to an array.
If this condition is not respected, a UI error will be generated.
Swap
WINDEV, WINDEV Mobile and WEBDEV allow you to automatically transform a Check Box control into a Radio Button control (and vice versa):
  1. Select the control to transform in the window or page.
  2. On the "Modification", in the "Transformations" group, expand "Refactoring and swapping" and select "Radio Button / Check Box".
Related Examples:
The Check Box control Unit examples (WINDEV): The Check Box control
[ + ] Using a check box control.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/23/2023

Send a report | Local help