Home | Sign in | English UK
  • Overview of the Switch control
  • Creating a Switch control
  • Characteristics of the Switch control
  • "General" tab
  • "Style" tab
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
Overview of the Switch control
Switch controls (also called "Toggle controls") are now commonly used in interfaces.
The Switch control is a 2-state Check Box control (on/off, true/false, yes/no). However, instead of checking a box, the user switches the cursor from right to left (and vice versa) to change the state:
  • the cursor moves when the control is clicked on.
  • the cursor can be moved using the mouse.
On touch screens (smartphones, etc.), the control reacts in a natural way (touch slide).
Examples of Switch controls in both possible positions
Examples of Switch controls in both possible positions
Creating a Switch control
To create a Switch control:
  1. On the "Creation" pane, in the "Usual controls" group, expand "Check Box".
  2. The list of available controls is displayed with the project skin template:
  3. Select the desired Switch control.
  4. Click where the control will be created in the window or page. The control appears in the editor.
To view the control characteristics, select "Description" in the popup menu of the control.
Characteristics of the Switch control
The description window of the Switch control is used to easily modify its characteristics:
  • The control display mode can be defined in the "General" tab
  • The look of the elements in the Switch control can be customized in the "Style" tab.

"General" tab

The following options are available in the "General" tab:
  • Display mode: : Allows you to define if the captions of the control options will be displayed, and where they will be displayed.
    • presence of a caption:
      • if only one caption is visible: the caption is uncovered depending on whether you switch to the right or left.
      • if both captions are visible: the caption that represents the current state is highlighted through its style (font, color, size, etc.).
    • position of the caption(s):
      • internal: the caption is displayed inside the control, over the background.
      • external: the caption is displayed outside the control (right and/or left).
  • Caption alignment: : Allows you to align the option captions. This option depends on the display mode chosen.
The "General" tab also allows you to enter the caption of the "ON" and "OFF" options and the corresponding value returned to the program. This value will be handled in the WLanguage code. By default, this value corresponds to 0 for the OFF value, and to 1 for the ON value (like a boolean). It is possible to return a value composed of numbers and/or letters. In this case, ..Value will not return the value as a boolean, but as a text value.
The option "Forces the cursor width to take up half of the track" allows you to use half the width of the control to draw the Switch control when the text is outside. This option is not valid if the captions are inside the control, on the background.

"Style" tab

The "Style" tab allows you to customize the style of the Switch control. You can customize: the ON and/or the OFF value for each control state.
In each case, different elements of the control can be customized: border of the track, border of the cursor, etc.
see Customizing the Switch controls for more details.
Minimum version required
  • Version 24
This page is also available for…
Click [Add] to post a comment