RadToggleSwitch
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
Initializes a new instance of the RadToggleSwitch class.
public RadToggleSwitch()
Properties
Gets or sets a value indicating whether to use animation when changing its state.
public bool AllowAnimation { get; set; }
Gets or sets the animation frames.
public int AnimationFrames { get; set; }
Gets or sets the animation interval.
public int AnimationInterval { get; set; }
Gets the default size of the RadToggleSwitch control.
protected override Size DefaultSize { get; }
A Size representing the default control dimensions.
Overrides:
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.
public int DragSize { get; set; }
Gets or sets a value indicating whether the UI Automation functionality is enabled or disabled for this control.
public override bool EnableUIAutomation { get; set; }
Overrides:
Implements:
Gets or sets the Font of the control. This actually the Font property of the root element.
public override Font Font { get; set; }
Overrides:
Gets a value indicating whether the control is currently animating.
[Browsable(false)]
public bool IsAnimating { get; }
Gets the off element of RadToggleSwitch.
public ToggleSwitchPartElement OffElement { get; }
Gets or sets the text displayed when the state is Off.
public string OffText { get; set; }
Gets the on element of RadToggleSwitch.
public ToggleSwitchPartElement OnElement { get; }
Gets or sets the text displayed when the state is On.
public string OnText { get; set; }
Gets or sets a value indicating whether the value could be changed.
public bool ReadOnly { get; set; }
Determines how far the switch needs to be dragged before it snaps to the opposite side.
public double SwitchElasticity { get; set; }
Gets the thumb of RadToggleSwitch.
public ToggleSwitchThumbElement Thumb { get; }
Gets or sets width of the thumb.
[VsbBrowsable(true)]
public int ThumbTickness { get; set; }
Determines how ToggleSwitch button should handle mouse click and drag.
public ToggleStateMode ToggleStateMode { get; set; }
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.
[Browsable(false)]
public RadToggleSwitchElement ToggleSwitchElement { get; }
Methods
Creates and initializes the child elements of the toggle switch control.
protected override void CreateChildItems(RadElement parent)
The parent RadElement to which child elements will be added.
Overrides:
Handles the Load event by enabling pan gesture support for the control.
protected override void OnLoad(Size desiredSize)
The desired size for the control.
Overrides:
Resets the background color theme overrides.
protected override void ResetBackColorThemeOverrides()
Overrides:
Resets the foreground color theme overrides.
protected override void ResetForeColorThemeOverrides()
Overrides:
Applies background color theme overrides to all available visual states.
protected override void SetBackColorThemeOverrides()
Overrides:
Applies foreground color theme overrides to all available visual states.
protected override void SetForeColorThemeOverrides()
Overrides:
Sets the value of RadToggleSwitch.
Toggles the value of RadToggleSwitch
public void Toggle()
Toggles the value of RadToggleSwitch
Events
Occurs when the animation finishes.
public event AnimationFinishedEventHandler AnimationFinished
Occurs when the animation starts.
public event AnimationStartedEventHandler AnimationStarted
Occurs when the Value has changed.
public event EventHandler ValueChanged
Occurs when the Value is about to change. Cancelable.
public event ValueChangingEventHandler ValueChanging