skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class RadToggleSwitch

Represents a toggle switch control that allows users to switch between two states.

Inheritance
System.Object
RadControl
RadToggleSwitch
Inherited Members
RadControl.isResizing2
RadControl.isDisposing2
RadControl.invalidResizeRect
RadControl.isAccessibilityRequested
RadControl.Dispose(Boolean)
RadControl.Construct()
RadControl.CreateBehavior()
RadControl.CreateRootElement()
RadControl.InitializeRootElement(RootRadElement)
RadControl.LoadElementTree()
RadControl.LoadElementTree(Size)
RadControl.SetIsInitializing(Boolean)
RadControl.ShouldSerializeBackColor()
RadControl.ShouldSerializeForeColor()
RadControl.ShouldSerializeFont()
RadControl.OnKeyDown(KeyEventArgs)
RadControl.OnKeyUp(KeyEventArgs)
RadControl.OnPreviewKeyDown(PreviewKeyDownEventArgs)
RadControl.OnKeyPress(KeyPressEventArgs)
RadControl.OnClick(EventArgs)
RadControl.OnDoubleClick(EventArgs)
RadControl.OnMouseDown(MouseEventArgs)
RadControl.OnMouseUp(MouseEventArgs)
RadControl.OnMouseEnter(EventArgs)
RadControl.OnMouseLeave(EventArgs)
RadControl.OnMouseMove(MouseEventArgs)
RadControl.OnMouseHover(EventArgs)
RadControl.OnMouseWheel(MouseEventArgs)
RadControl.OnMouseCaptureChanged(EventArgs)
RadControl.OnLostFocus(EventArgs)
RadControl.OnCreateControl()
RadControl.OnHandleDestroyed(EventArgs)
RadControl.OnParentChanged(EventArgs)
RadControl.OnVisibleChanged(EventArgs)
RadControl.OnFontChanged(EventArgs)
RadControl.OnForeColorChanged(EventArgs)
RadControl.OnBackColorChanged(EventArgs)
RadControl.OnEnabledChanged(EventArgs)
RadControl.OnBindingContextChanged(EventArgs)
RadControl.OnLocationChanged(EventArgs)
RadControl.OnPaddingChanged(EventArgs)
RadControl.OnRightToLeftChanged(EventArgs)
RadControl.OnPaint(PaintEventArgs)
RadControl.OnLayout(LayoutEventArgs)
RadControl.OnAutoSizeChanged(EventArgs)
RadControl.OnInvalidated(RadElement)
RadControl.OnCaptureLosing()
RadControl.OnThemeChanged()
RadControl.OnToolTipTextNeeded(Object, ToolTipTextNeededEventArgs)
RadControl.OnScreenTipNeeded(Object, ScreenTipNeededEventArgs)
RadControl.OnThemeNameChanged(ThemeNameChangedEventArgs)
RadControl.ProcessMnemonic(Char)
RadControl.ProcessFocusRequested(RadElement)
RadControl.ProcessCaptureChangeRequested(RadElement, Boolean)
RadControl.ProcessAutoSizeChanged(Boolean)
RadControl.CallOnMouseCaptureChanged(EventArgs)
RadControl.CallBaseOnGotFocus(EventArgs)
RadControl.CallBaseOnLostFocus(EventArgs)
RadControl.CallOnToolTipTextNeeded(Object, ToolTipTextNeededEventArgs)
RadControl.CallOnScreenTipNeeded(Object, ScreenTipNeededEventArgs)
RadControl.CallOnMouseUp(MouseEventArgs)
RadControl.CallOnMouseDown(MouseEventArgs)
RadControl.CallOnClick(EventArgs)
RadControl.CallOnDoubleClick(EventArgs)
RadControl.CallOnMouseEnter(EventArgs)
RadControl.CallOnMouseWheel(MouseEventArgs)
RadControl.CallOnMouseLeave(EventArgs)
RadControl.CallOnMouseMove(MouseEventArgs)
RadControl.CallOnMouseHover(EventArgs)
RadControl.CallOnPreviewKeyDown(PreviewKeyDownEventArgs)
RadControl.CallBaseOnKeyDown(KeyEventArgs)
RadControl.CallOnKeyDown(KeyEventArgs)
RadControl.CallBaseOnKeyPress(KeyPressEventArgs)
RadControl.CallOnKeyPress(KeyPressEventArgs)
RadControl.GetInputElement()
RadControl.CallBaseOnKeyUp(KeyEventArgs)
RadControl.CallOnKeyUp(KeyEventArgs)
RadControl.CallOnThemeNameChanged(ThemeNameChangedEventArgs)
RadControl.CallOnVisibleChanged(EventArgs)
RadControl.BeginInit()
RadControl.EndInit()
RadControl.OnNotifyPropertyChanged(String)
RadControl.OnNotifyPropertyChanged(PropertyChangedEventArgs)
RadControl.IComponentTreeHandler.GetShowFocusCues()
RadControl.IComponentTreeHandler.CreateRootElement()
RadControl.IComponentTreeHandler.CreateChildItems(RadElement)
RadControl.IComponentTreeHandler.InitializeRootElement(RootRadElement)
RadControl.IComponentTreeHandler.InvalidateElement(RadElement)
RadControl.IComponentTreeHandler.InvalidateElement(RadElement, Rectangle)
RadControl.IComponentTreeHandler.InvalidateIfNotSuspended()
RadControl.IComponentTreeHandler.GetAmbientPropertyValue(RadProperty)
RadControl.IComponentTreeHandler.ControlThemeChangedCallback()
RadControl.IComponentTreeHandler.OnAmbientPropertyChanged(RadProperty)
RadControl.IComponentTreeHandler.OnFocusRequested(RadElement)
RadControl.IComponentTreeHandler.OnCaptureChangeRequested(RadElement, Boolean)
RadControl.IComponentTreeHandler.OnDisplayPropertyChanged(RadPropertyChangedEventArgs)
RadControl.IComponentTreeHandler.CallOnThemeNameChanged(ThemeNameChangedEventArgs)
RadControl.IComponentTreeHandler.CallOnMouseCaptureChanged(EventArgs)
RadControl.IComponentTreeHandler.CallOnToolTipTextNeeded(Object, ToolTipTextNeededEventArgs)
RadControl.IComponentTreeHandler.CallOnScreenTipNeeded(Object, ScreenTipNeededEventArgs)
RadControl.GetPreferredSize(Size)
RadControl.SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified)
RadControl.GetRootElementDesiredSize(Int32, Int32, Int32, Int32)
RadControl.OnZoomGesture(ZoomGestureEventArgs)
RadControl.OnRotateGesture(RotateGestureEventArgs)
RadControl.OnPanGesture(PanGestureEventArgs)
RadControl.OnTwoFingerTapGesture(GestureEventArgs)
RadControl.OnPressAndTapGesture(PressAndTapGestureEventArgs)
RadControl.OnGesture(GestureEventArgs)
RadControl.ProcessGesture(Message)
RadControl.EnableGesture(GestureType)
RadControl.DisableGesture(GestureType)
RadControl.Refresh()
RadControl.SuspendUpdate()
RadControl.ResumeUpdate()
RadControl.ResumeUpdate(Boolean)
RadControl.InvokeLayoutCallback(LayoutCallback)
RadControl.RegisterHostedControl(RadHostItem)
RadControl.UnregisterHostedControl(RadHostItem, Boolean)
RadControl.ControlDefinesThemeForElement(RadElement)
RadControl.ResolveStyleGroupForElement(StyleGroup, RadObject)
RadControl.GetPlainText()
RadControl.CanEditUIElement(RadElement)
RadControl.GetChildAt(Int32)
RadControl.ShouldSerializeProperty(RadProperty)
RadControl.ShouldSerializeProperty(RadProperty, RadObject)
RadControl.ResetProperty(RadProperty, RadObject)
RadControl.CanEditElementAtDesignTime(RadElement)
RadControl.GetControlDefaultSize()
RadControl.GetDpiScaledSize(Size)
RadControl.GetDpiScaledSize(SizeF)
RadControl.ProcessCodedUIMessage(IPCMessage)
RadControl.FindPropertyInChildren(RadControl, IPCMessage)
RadControl.CallAccessibilityNotifyClients(AccessibleEvents, Int32)
RadControl.IPCHost.ProcessMessage(IPCMessage)
RadControl.ScaleControl(SizeF, BoundsSpecified)
RadControl.PerformRadAutoScale(Nullable<BoundsSpecified>)
RadControl.SetRadAutoScale(Boolean)
RadControl.IComponentTreeHandler.get_Name()
RadControl.IComponentTreeHandler.set_Name(String)
RadControl.EnableDpiScaling
RadControl.EnableRadAutoScale
RadControl.EnableRadFormInitialDpiScaling
RadControl.EnableImageDpiScaling
RadControl.EnableSvgImages
RadControl.IsTrial
RadControl.IsLoaded
RadControl.LayoutManager
RadControl.ElementTree
RadControl.UseCompatibleTextRenderingDefaultValue
RadControl.Behavior
RadControl.RootElement
RadControl.Padding
RadControl.ThemeName
RadControl.EnableTheming
RadControl.ThemeClassName
RadControl.ImageList
RadControl.ImageScalingSize
RadControl.UseCompatibleTextRendering
RadControl.AutoSize
RadControl.MaximumSize
RadControl.MinimumSize
RadControl.Focusable
RadControl.Site
RadControl.CausesValidation
RadControl.IsInitializing
RadControl.SmallImageList
RadControl.SmallImageScalingSize
RadControl.IsDesignMode
RadControl.IsDisplayed
RadControl.FocusedElement
RadControl.AllowShowFocusCues
RadControl.ShowItemToolTips
RadControl.CommandBindings
RadControl.EnableKeyMap
RadControl.ValidationCancel
RadControl.IComponentTreeHandler.IsDesignMode
RadControl.IComponentTreeHandler.ElementTree
RadControl.IComponentTreeHandler.Behavior
RadControl.IComponentTreeHandler.Initializing
RadControl.IComponentTreeHandler.ThemeClassName
RadControl.EnableGestures
RadControl.EnableAnalytics
RadControl.AnalyticsName
RadControl.EnableRadAccessibilityObjects
RadControl.AccessibilityRequested
RadControl.EnableCodedUITests
RadControl.EnableCodedUITestsDefaultValue
RadControl.EnableUIAutomationDefaultValue
RadControl.IPCHost.Context
RadControl.ElementInvalidated
RadControl.ToolTipTextNeeded
RadControl.ScreenTipNeeded
RadControl.ThemeNameChanged
RadControl.Initialized
RadControl.PropertyChanged
RadControl.ZoomGesture
RadControl.RotateGesture
RadControl.PanGesture
RadControl.TwoFingerTapGesture
RadControl.PressAndTapGesture
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll

Syntax

public class RadToggleSwitch : RadControl, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IPCHost, IAnalyticsProvider, ISupportRootUIAutomation

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.

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
RadControl.BackColor

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
RadControl.EnableUIAutomation
Implements
ISupportRootUIAutomation.EnableUIAutomation

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
RadControl.Font

ForeColor

This property is not relevant for this class.

Declaration
public override Color ForeColor { get; set; }
Property Value
System.Drawing.Color

Overrides
RadControl.ForeColor

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
RadControl.Text

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
RadControl.CreateChildItems(RadElement)

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
RadControl.IsInputKey(Keys)

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
RadControl.OnGotFocus(EventArgs)

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
RadControl.OnLoad(Size)

ResetBackColorThemeOverrides()

Resets the background color theme overrides.

Declaration
protected override void ResetBackColorThemeOverrides()
Overrides
RadControl.ResetBackColorThemeOverrides()

ResetForeColorThemeOverrides()

Resets the foreground color theme overrides.

Declaration
protected override void ResetForeColorThemeOverrides()
Overrides
RadControl.ResetForeColorThemeOverrides()

SetBackColorThemeOverrides()

Applies background color theme overrides to all available visual states.

Declaration
protected override void SetBackColorThemeOverrides()
Overrides
RadControl.SetBackColorThemeOverrides()

SetForeColorThemeOverrides()

Applies foreground color theme overrides to all available visual states.

Declaration
protected override void SetForeColorThemeOverrides()
Overrides
RadControl.SetForeColorThemeOverrides()

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
RadControl.WndProc(ref Message)

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.DisposeUIAutomationProvider()

ISupportRootUIAutomation.InitializeUIAutomationProvider()

Creates the UI Automation provider for this control.

Declaration
void ISupportRootUIAutomation.InitializeUIAutomationProvider()
Implements
ISupportRootUIAutomation.InitializeUIAutomationProvider()

ISupportRootUIAutomation.RootUIAutomationManager

Gets the UI Automation Manager for this control.

Declaration
IRootUIAutomationManager ISupportRootUIAutomation.RootUIAutomationManager { get; }
Returns
IRootUIAutomationManager

Implements
ISupportRootUIAutomation.RootUIAutomationManager

ISupportRootUIAutomation.UIAutomationProvider

Gets the UI Automation Provider for this control.

Declaration
IRadRawElementProviderFragmentRoot ISupportRootUIAutomation.UIAutomationProvider { get; }
Returns
IRadRawElementProviderFragmentRoot

Implements
ISupportRootUIAutomation.UIAutomationProvider

Extension Methods

SvgExtentions.Traverse<T>(T, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(T, Func<T, IEnumerable<T>>)
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.