Edit this page

Accessing and Customizing Elements

Accessing and customizing elements can be performed either at design time, or at run time. Before proceeding with this topic, it is recommended to get familiar with the visual structure of the RadToggleButton.

Design time

You can access and modify the style for different elements in RadToggleButton by using the Element hierarchy editor.

Fig.1 Element hierarchy editor

togglebutton-customizing-appearance-accessing-and-customizing-elements 001

Programmatically

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

Fig.2 Customize elements

togglebutton-customizing-appearance-accessing-and-customizing-elements 002

Customize elements

this.radToggleButton1.ButtonElement.TextElement.ForeColor = Color.Red;
this.radToggleButton1.ButtonElement.ButtonFillElement.BackColor = Color.Aqua;
this.radToggleButton1.ButtonElement.BorderElement.BoxStyle = Telerik.WinControls.BorderBoxStyle.FourBorders;
this.radToggleButton1.ButtonElement.BorderElement.TopColor = Color.Aqua;
this.radToggleButton1.ButtonElement.BorderElement.BottomColor = Color.Aqua;
this.radToggleButton1.ButtonElement.BorderElement.LeftColor = Color.Red;
this.radToggleButton1.ButtonElement.BorderElement.RightColor = Color.Red;

Me.radToggleButton1.ButtonElement.TextElement.ForeColor = Color.Red
Me.radToggleButton1.ButtonElement.ButtonFillElement.BackColor = Color.Aqua
Me.radToggleButton1.ButtonElement.BorderElement.BoxStyle = Telerik.WinControls.BorderBoxStyle.FourBorders
Me.radToggleButton1.ButtonElement.BorderElement.TopColor = Color.Aqua
Me.radToggleButton1.ButtonElement.BorderElement.BottomColor = Color.Aqua
Me.radToggleButton1.ButtonElement.BorderElement.LeftColor = Color.Red
Me.radToggleButton1.ButtonElement.BorderElement.RightColor = Color.Red