ToggleSwitch
A check box drawn as a sliding switch, in the style used by modern desktop and mobile platforms, with an optional rounded border.
public class ToggleSwitch : Control
Inherits from / implements: Control
Remarks
This is a thin public shell. Every appearance property is forwarded to an internal ToggleCheckButton, which is what actually composes and paints the switch. The separation exists so the public surface can stay small and stable while the interior is free to change.
Members at a glance
ToggleSwitch | Initializes a new instance of the ToggleSwitch class. |
BorderColor | Gets or sets the color of the border. |
CheckedStateBackColor | Gets or sets the back-color of the checked state. |
CheckedStateImage | Gets or sets the checked state image. |
CheckedText | Gets or sets the checked state text. |
GradientColor | Gets or sets the colour the moving part's vertical gradient starts from. |
IsChecked | Gets or sets a value indicating whether this instance is checked. |
OnHoverBackColor | Gets or sets the back color for the hover. |
ShouldDrawBorder | Gets or sets a value indicating whether the control should draw border. |
ShouldUseImageForCheckedState | Gets or sets a value indicating whether the control should use image for checked state. |
UnCheckedStateBackColor | Gets or sets the back-color of the unchecked state. |
UnCheckedStateImage | Gets or sets the unchecked state image. |
UnCheckedText | Gets or sets the unchecked state text. |
OnGotFocus | — |
OnKeyUp | — |
OnLostFocus | — |
OnPaint | — |
OnResize | — |
OnSizeChanged | — |
IsCheckedChanged | Occurs when the control's IsChecked property changes. |
Constructors
ToggleSwitch
Initializes a new instance of the ToggleSwitch class.
Properties
BorderColor
Gets or sets the color of the border.
CheckedStateBackColor
Gets or sets the back-color of the checked state.
CheckedStateImage
Gets or sets the checked state image.
Value. The checked state image.
CheckedText
Gets or sets the checked state text.
GradientColor
Gets or sets the colour the moving part's vertical gradient starts from.
Value. The colour of the gradient.
IsChecked
Gets or sets a value indicating whether this instance is checked.
OnHoverBackColor
Gets or sets the back color for the hover.
ShouldDrawBorder
Gets or sets a value indicating whether the control should draw border.
ShouldUseImageForCheckedState
Gets or sets a value indicating whether the control should use image for checked state.
CheckedStateImage and UnCheckedStateImage are shown in place of CheckedText and UnCheckedText.UnCheckedStateBackColor
Gets or sets the back-color of the unchecked state.
UnCheckedStateImage
Gets or sets the unchecked state image.
Value. The unchecked state image.
UnCheckedText
Gets or sets the unchecked state text.
Methods
OnGotFocus
No summary in the source yet.
OnKeyUp
No summary in the source yet.
OnLostFocus
No summary in the source yet.
OnPaint
No summary in the source yet.
OnResize
No summary in the source yet.
OnSizeChanged
No summary in the source yet.
Events
IsCheckedChanged
Occurs when the control's IsChecked property changes.