Switch
Switch for switching an option on or off.
|
Symbol |
|
|
Menu ribbon |
Start > Controls > Buttons > Switches and buttons > Switch |
The "Switch" control element is used to change a binary process variable value. Pressing the switch toggles the value (falseæ true or trueæfalse). The actuation (press/release) and the status of the process variable is graphically animated, e.g. by means of shadow effects and colour changes.
Switch deactivated (off) and switch activated (on)
Functionalities
The control element supports the following functionality:
-
Connection to a binary process variable(one bit) for the data source
-
Display of a language-switchable text for labelling
-
Display of a language-switchable text in the control element
-
Representation of the handle
-
Representation of the rail
-
Connection to the user administration for blocking operability
-
Display of the background, the frame, the shadow, etc.
-
Colour display of the background, frame, text, etc., also depending on the status of the control element
You can configure these functionalities via the properties in the Properties window when you select the control in the Designer or in the document outline. Whether a property is visible in the properties window depends on the style of the control.
Style
By default, the control uses the "Plain.Default" style. Other system styles are available for the control in the "Style" property from the "General properties" category.
Certain properties may be missing in the Properties window for styled controls. For example, the "Colours" category is not available for controls in the system styles. These properties cannot be edited in the system styles.
You can also create your own styles for the control element. These styles are available for selection in the "Style" property after creation.
Structure
The control element consists of a number of other elements. Both the control itself and its elements can be configured via the properties of the control. Properties for a sub-element of the control can usually be found in the category that bears the name of this element.
Example: The properties for configuring the "Label" element can be found in the Properties window in the "Label" category when you select the control element in the Designer or in the document outline.
The switch and its elements
Thumb
If the style of the control element is reset, the following can be configured for the handle via the properties of the "Thumb" category:
-
Width and height (ThumbWidth, ThumbHeight)
-
Outer distances (ThumbMargin)
-
Border (ThumbBorderRadius, ThumbBorderStyle, ThumbBorderWidth)
-
Shadow (ThumbShadow)
-
Text(ThumbTextOff, ThumbTextOn, etc.)
Track
If the style of the control element is reset, the following can be configured for the track via the properties of the "Track" category:
-
Width and height (TrackWidth, TrackHeight)
-
Outer distances (TrackMargin)
-
Border (TrackBorderRadius, TrackBorderStyle, TrackBorderWidth)
Related topics: