ClassRadToggleSwitch
Represents a toggle switch control that allows users to switch between two states.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class RadToggleSwitch : RadControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider, ISupportRootUIAutomation
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadToggleSwitch
Implements:
Inherited Members
Constructors
RadToggleSwitch()
Initializes a new instance of the RadToggleSwitch class.
Declaration
public RadToggleSwitch()
Properties
AllowAnimation
Gets or sets a value indicating whether to use animation when changing its state.
AnimationFrames
Gets or sets the animation frames.
AnimationInterval
Gets or sets the animation interval.
DefaultSize
Gets the default size of the RadToggleSwitch control.
DragSize
Gets or sets the width and height of a rectangle centered on the point the mouse button was pressed, within which a drag operation will not begin. This property is used to differentiate the Drag and Click mouse operations. If the end user drags the mouse less pixels than the value of this property and releases the mouse button, the operation will be considered as a mouse click.
EnableUIAutomation
Gets or sets a value indicating whether the UI Automation functionality is enabled or disabled for this control.
Declaration
public override bool EnableUIAutomation { get; set; }
Property Value
Overrides
Implements
Font
Gets or sets the Font of the control. This actually the Font property of the root element.
IsAnimating
Gets a value indicating whether the control is currently animating.
Declaration
[Browsable(false)]
public bool IsAnimating { get; }
Property Value
OffElement
Gets the off element of RadToggleSwitch.
Declaration
public ToggleSwitchPartElement OffElement { get; }
Property Value
OffText
Gets or sets the text displayed when the state is Off.
OnElement
Gets the on element of RadToggleSwitch.
Declaration
public ToggleSwitchPartElement OnElement { get; }
Property Value
OnText
Gets or sets the text displayed when the state is On.
ReadOnly
Gets or sets a value indicating whether the value could be changed.
SwitchElasticity
Determines how far the switch needs to be dragged before it snaps to the opposite side.
Thumb
Gets the thumb of RadToggleSwitch.
Declaration
public ToggleSwitchThumbElement Thumb { get; }
Property Value
ThumbTickness
Gets or sets width of the thumb.
Declaration
[VsbBrowsable(true)]
public int ThumbTickness { get; set; }
Property Value
ToggleStateMode
Determines how ToggleSwitch button should handle mouse click and drag.
Declaration
public ToggleStateMode ToggleStateMode { get; set; }
Property Value
ToggleSwitchElement
Gets the instance of RadToggleSwitchElement wrapped by this control. RadToggleSwitchElement is the main element in the hierarchy tree and encapsulates the actual functionality of RadToggleSwitch.
Declaration
[Browsable(false)]
public RadToggleSwitchElement ToggleSwitchElement { get; }
Property Value
Methods
CreateChildItems(RadElement)
Creates and initializes the child elements of the toggle switch control.
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
parent
The parent RadElement to which child elements will be added.
Overrides
IsInputKey(Keys)
Determines which keys are input keys for the control, enabling arrow key navigation.
OnGotFocus(EventArgs)
Handles the GotFocus event by focusing the toggle switch element.
OnLoad(Size)
Handles the Load event by enabling pan gesture support for the control.
Declaration
protected override void OnLoad(Size desiredSize)
Parameters
desiredSize
The desired size for the control.
Overrides
ResetBackColorThemeOverrides()
Resets the background color theme overrides.
Declaration
protected override void ResetBackColorThemeOverrides()
Overrides
ResetForeColorThemeOverrides()
Resets the foreground color theme overrides.
Declaration
protected override void ResetForeColorThemeOverrides()
Overrides
SetBackColorThemeOverrides()
Applies background color theme overrides to all available visual states.
Declaration
protected override void SetBackColorThemeOverrides()
Overrides
SetForeColorThemeOverrides()
Applies foreground color theme overrides to all available visual states.
Declaration
protected override void SetForeColorThemeOverrides()
Overrides
SetToggleState(bool)
Sets the value of RadToggleSwitch.
Declaration
public void SetToggleState(bool newValue)
Parameters
newValue
The new value.
SetToggleState(bool, bool)
Sets the value of RadToggleSwitch.
Toggle(bool)
Toggles the value of RadToggleSwitch
Declaration
public void Toggle(bool animate)
Parameters
animate
Indicates whether to use animation.
WndProc(ref Message)
Processes Windows messages, handling UI Automation messages and other control-specific messages.
Events
AnimationFinished
Occurs when the animation finishes.
Declaration
public event AnimationFinishedEventHandler AnimationFinished
Event Value
AnimationStarted
Occurs when the animation starts.
Declaration
public event AnimationStartedEventHandler AnimationStarted
Event Value
ValueChanged
Occurs when the Value has changed.
ValueChanging
Occurs when the Value is about to change. Cancelable.
Declaration
public event ValueChangingEventHandler ValueChanging
Event Value