Class RadToggleSwitch
Represents a toggle switch control that allows users to switch between two states.
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadToggleSwitch : RadControl, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IPCHost, IAnalyticsProvider, ISupportRootUIAutomation
Constructors
RadToggleSwitch()
Properties
AllowAnimation
Gets or sets a value indicating whether to use animation when changing its state.
Declaration
public bool AllowAnimation { get; set; }
Property Value
|
System.Boolean
|
AnimationFrames
Gets or sets the animation frames.
Declaration
public int AnimationFrames { get; set; }
Property Value
|
System.Int32
|
AnimationInterval
Gets or sets the animation interval.
Declaration
public int AnimationInterval { get; set; }
Property Value
|
System.Int32
|
BackColor
This property is not relevant for this class.
Declaration
public override Color BackColor { get; set; }
Property Value
|
System.Drawing.Color
|
Overrides
DefaultSize
Gets the default size of the RadToggleSwitch control.
Declaration
protected override Size DefaultSize { get; }
Property Value
|
System.Drawing.Size
A System.Drawing.Size representing the default control dimensions. |
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.
Declaration
public int DragSize { get; set; }
Property Value
|
System.Int32
|
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
|
System.Boolean
|
Overrides
Implements
Font
Gets or sets the Font of the control. This actually the Font property of the root element.
Declaration
public override Font Font { get; set; }
Property Value
|
System.Drawing.Font
|
Overrides
ForeColor
This property is not relevant for this class.
Declaration
public override Color ForeColor { get; set; }
Property Value
|
System.Drawing.Color
|
Overrides
IsAnimating
Gets a value indicating whether the control is currently animating.
Declaration
public bool IsAnimating { get; }
Property Value
|
System.Boolean
|
OffElement
Gets the off element of RadToggleSwitch.
Declaration
public ToggleSwitchPartElement OffElement { get; }
Property Value
|
ToggleSwitchPartElement
|
OffText
Gets or sets the text displayed when the state is Off.
Declaration
public string OffText { get; set; }
Property Value
|
System.String
|
OnElement
Gets the on element of RadToggleSwitch.
Declaration
public ToggleSwitchPartElement OnElement { get; }
Property Value
|
ToggleSwitchPartElement
|
OnText
Gets or sets the text displayed when the state is On.
Declaration
public string OnText { get; set; }
Property Value
|
System.String
|
ReadOnly
Gets or sets a value indicating whether the value could be changed.
Declaration
public bool ReadOnly { get; set; }
Property Value
|
System.Boolean
|
SwitchElasticity
Determines how far the switch needs to be dragged before it snaps to the opposite side.
Declaration
public double SwitchElasticity { get; set; }
Property Value
|
System.Double
|
Text
This property is not relevant for this class.
Declaration
public override string Text { get; set; }
Property Value
|
System.String
|
Overrides
Thumb
Gets the thumb of RadToggleSwitch.
Declaration
public ToggleSwitchThumbElement Thumb { get; }
Property Value
|
ToggleSwitchThumbElement
|
ThumbTickness
Gets or sets width of the thumb.
Declaration
[VsbBrowsable(true)]
public int ThumbTickness { get; set; }
Property Value
|
System.Int32
|
ToggleStateMode
Determines how ToggleSwitch button should handle mouse click and drag.
Declaration
public ToggleStateMode ToggleStateMode { get; set; }
Property Value
|
ToggleStateMode
|
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
public RadToggleSwitchElement ToggleSwitchElement { get; }
Property Value
|
RadToggleSwitchElement
|
Value
Gets or sets the value.
Declaration
public bool Value { get; set; }
Property Value
|
System.Boolean
|
Methods
CreateChildItems(RadElement)
Creates and initializes the child elements of the toggle switch control.
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
|
RadElement
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.
Declaration
protected override bool IsInputKey(Keys keyData)
Parameters
|
System.Windows.Forms.Keys
keyData
The key data to check. |
Returns
|
System.Boolean
true if the specified key is an input key; otherwise, false. |
Overrides
OnGotFocus(EventArgs)
Handles the GotFocus event by focusing the toggle switch element.
Declaration
protected override void OnGotFocus(EventArgs e)
Parameters
|
System.EventArgs
e
An System.EventArgs that contains the event data. |
Overrides
OnLoad(Size)
Handles the Load event by enabling pan gesture support for the control.
Declaration
protected override void OnLoad(Size desiredSize)
Parameters
|
System.Drawing.Size
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(Boolean)
Sets the value of RadToggleSwitch.
Declaration
public void SetToggleState(bool newValue)
Parameters
|
System.Boolean
newValue
The new value. |
SetToggleState(Boolean, Boolean)
Sets the value of RadToggleSwitch.
Declaration
public void SetToggleState(bool newValue, bool animate)
Parameters
|
System.Boolean
newValue
The new value. |
|
System.Boolean
animate
Indicates whether to use animation. |
Toggle()
Toggles the value of RadToggleSwitch
Declaration
public void Toggle()
Toggle(Boolean)
Toggles the value of RadToggleSwitch
Declaration
public void Toggle(bool animate)
Parameters
|
System.Boolean
animate
Indicates whether to use animation. |
WndProc(ref Message)
Processes Windows messages, handling UI Automation messages and other control-specific messages.
Declaration
protected override void WndProc(ref Message m)
Parameters
|
System.Windows.Forms.Message
m
The Windows System.Windows.Forms.Message to process. |
Overrides
Events
AnimationFinished
Occurs when the animation finishes.
Declaration
public event AnimationFinishedEventHandler AnimationFinished
Event Type
|
AnimationFinishedEventHandler
|
AnimationStarted
Occurs when the animation starts.
Declaration
public event AnimationStartedEventHandler AnimationStarted
Event Type
|
AnimationStartedEventHandler
|
ValueChanged
Occurs when the Value has changed.
Declaration
public event EventHandler ValueChanged
Event Type
|
System.EventHandler
|
ValueChanging
Occurs when the Value is about to change. Cancelable.
Declaration
public event ValueChangingEventHandler ValueChanging
Event Type
|
ValueChangingEventHandler
|
Explicit Interface Implementations
ISupportRootUIAutomation.DisposeUIAutomationProvider()
Clears the UI Automation provider for this control.
Declaration
void ISupportRootUIAutomation.DisposeUIAutomationProvider()
Implements
ISupportRootUIAutomation.InitializeUIAutomationProvider()
Creates the UI Automation provider for this control.
Declaration
void ISupportRootUIAutomation.InitializeUIAutomationProvider()
Implements
ISupportRootUIAutomation.RootUIAutomationManager
Gets the UI Automation Manager for this control.
Declaration
IRootUIAutomationManager ISupportRootUIAutomation.RootUIAutomationManager { get; }
Returns
|
IRootUIAutomationManager
|
Implements
ISupportRootUIAutomation.UIAutomationProvider
Gets the UI Automation Provider for this control.
Declaration
IRadRawElementProviderFragmentRoot ISupportRootUIAutomation.UIAutomationProvider { get; }
Returns
|
IRadRawElementProviderFragmentRoot
|