A control that the user can turn on or off by moving its handle.

Description

A toggle is designed for recent GUIs but behaves the same way as a check box.

Key properties

Default – The initial value of a control before it is changed by the user.

Value – The value of an input control.

Additional properties

BorderColor – The color of a control's border.

BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.

BorderThickness – The thickness of a control's border.

FocusedBorderThickness – The thickness of the control's border when it has keyboard focus.

DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).

DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to Disabled.

Fill – The background color of a control.

Height – The distance between a control's top and bottom edges.

HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that control.

OnChange – How the app responds when the user changes the value of a control (for example, by adjusting a slider).

OnCheck – How an app responds when the value of a checkbox or a toggle changes to true.

OnSelect – How the app responds when the user taps or clicks a control.

OnUncheck – How an app responds when the value of a checkbox or a toggle changes to false.

PressedBorderColor – The color of a control's border when the user taps or clicks that control.

RailFill – The background color of the rectangle in a toggle control when its value is false or the color of the line to the right of the handle in a slider control.

RailHoverFill – When you hover on a toggle control or a slider, the background color of the rectangle in a toggle control when its value is false or the color of the line to the right of the handle in a slider control.

Reset – Whether a control reverts to its default value.

TabIndex – Customizes the tab order of controls at runtime when set to a non-zero value.

Tooltip – Explanatory text that appears when the user hovers over a control.

ValueFill – The background color of the rectangle in a toggle control when its value is true or the color of the line to the left of the handle in a slider control.

ValueHoverFill – When you keep the mouse pointer on a toggle control or a slider, the background color of the rectangle in a toggle control when its value is true or the color of the line to the left of the handle in a slider control.

Visible – Whether a control appears or is hidden.

Width – The distance between a control's left and right edges.

X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent container).

Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent container).

Related functions

If( Condition, Result )

Example

  1. Add a toggle, and name it MemberDiscount.

    Don't know how to add, name, and configure a control?

  2. Add a label, and set its Text property to this formula:
    If(MemberDiscount.Value = true, "Price: $75", "Price: $100")

    Want more information about the If function or other functions?

  3. Press F5, and change the value of MemberDiscount.

    The label shows a different price, depending on whether MemberDiscount is on or off.

  4. To return to the default workspace, press Esc.