New to Telerik UI for WinForms? Start a free 30-day trial
Accessing and Customizing Elements
Updated over 6 months ago
Design time
You can access and modify the style for different elements in RadToggleSwitch by using the Element hierarchy editor. Before proceeding with this topic, it is recommended to get familiar with the visual structure of the RadToggleSwitch.
Figure 1: Element hierarchy editor

Programmatically
You can customize the nested elements at run time as well:
Figure 2:

Customizing elements at run time
C#
this.radToggleSwitch1.OnElement.BackColor = Color.GreenYellow;
this.radToggleSwitch1.OnElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
this.radToggleSwitch1.OnElement.ForeColor = Color.DarkCyan;
this.radToggleSwitch1.OffElement.BackColor = Color.Red;
this.radToggleSwitch1.OffElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
this.radToggleSwitch1.OffElement.ForeColor = Color.Yellow;
this.radToggleSwitch1.Thumb.BackColor = Color.Aqua;
this.radToggleSwitch1.Thumb.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
this.radToggleSwitch1.Thumb.BorderColor = Color.DarkViolet;
this.radToggleSwitch1.ToggleSwitchElement.BorderColor = Color.Fuchsia;