Class RadRadioButtonElement
Represents a radio button element. The RadRadioButton class is a simple wrapper for the RadRadioButtonElement class. The RadRadioButton acts to transfer events to and from its corresponding RadRadioButtonElement instance. The RadRadioButtonElement which is essentially the RadRadioButton control may be nested in other telerik controls.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadRadioButtonElement : RadToggleButtonElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IButtonControl, IImageElement
Constructors
RadRadioButtonElement()
Declaration
public RadRadioButtonElement()
Fields
RadioCheckAlignmentProperty
Registers the RadioCheckAlignment dependency property that defines the alignment of the radio button's check mark relative to the text.
Declaration
public static RadProperty RadioCheckAlignmentProperty
Field Value
RadProperty
|
Properties
AutoCheck
Gets or sets a value indicating whether the IsChecked value and the appearance of the control automatically change when the control is clicked. If the AutoCheck value is set to true, and the radio button is part of a RadRadioButton control group, this property ensures that only one of the controls is checked at a given time. If the AutoCheck property is set to false, a group of radio button controls will not act as a mutually exclusive group and the IsChecked property must be updated in code.
Declaration
public bool AutoCheck { get; set; }
Property Value
System.Boolean
|
Remarks
If the AutoCheck value is set to true, and the RadioButton is part of a RadRadioButton control group, this property ensures that only one of the controls is checked at a given time. If the AutoCheck property is set to false, a group of RadioButton controls will not act as a mutually exclusive group and the IsChecked property must be updated in code.
CheckMarkPrimitive
Gets the CheckMarkPrimitive primitive element that renders the radio button's check mark indicator. This primitive is responsible for displaying the circular selection state of the radio button.
Declaration
public RadRadiomark CheckMarkPrimitive { get; }
Property Value
RadRadiomark
|
RadioCheckAlignment
Gets or sets a value indicating the alignment of the radio button's check mark according to the text of the button. This property determines where the radio button circle appears in relation to the button text.
Declaration
public ContentAlignment RadioCheckAlignment { get; set; }
Property Value
System.Drawing.ContentAlignment
|
Methods
CreateChildElements()
Creates and initializes the child elements that compose the radio button's visual structure. This method sets up the fill primitive, border primitive, text element, image primitive, check mark primitive, and layout panels.
Declaration
protected override void CreateChildElements()
Overrides
GetFocusRect()
Gets the rectangle that defines the focus indicator area for the radio button. Returns the bounding rectangle of the text element if available, otherwise returns an empty rectangle.
Declaration
protected override Rectangle GetFocusRect()
Returns
System.Drawing.Rectangle
A System.Drawing.Rectangle that represents the focus indicator bounds. |
Overrides
GetSystemSkinPaintBounds()
Gets the bounds rectangle used for system skin painting. Returns the bounding rectangle of the check mark primitive when available.
Declaration
protected override Rectangle GetSystemSkinPaintBounds()
Returns
System.Drawing.Rectangle
A System.Drawing.Rectangle that defines the system skin painting bounds. |
Overrides
GetVistaVisualStyle()
Gets the Windows Vista visual style element for the radio button based on its current state. This method delegates to GetXPVisualStyle() for consistent styling across Windows versions.
Declaration
public override VisualStyleElement GetVistaVisualStyle()
Returns
System.Windows.Forms.VisualStyles.VisualStyleElement
A System.Windows.Forms.VisualStyles.VisualStyleElement that represents the appropriate Vista visual style for the current radio button state. |
Overrides
GetXPVisualStyle()
Gets the Windows XP visual style element for the radio button based on its current state. This method returns the appropriate visual style element considering the radio button's checked state, enabled state, and mouse interaction state.
Declaration
public override VisualStyleElement GetXPVisualStyle()
Returns
System.Windows.Forms.VisualStyles.VisualStyleElement
A System.Windows.Forms.VisualStyles.VisualStyleElement that represents the appropriate XP visual style for the current radio button state. |
Overrides
InitializeFields()
Initializes the default field values for the radio button element. Sets up the default text alignment and enables automatic checking behavior.
Declaration
protected override void InitializeFields()
Overrides
InitializeSystemSkinPaint()
Initializes the system skin painting settings and updates the text element's foreground color. This method is called when system skin rendering is enabled to ensure proper visual integration with the operating system theme.
Declaration
protected override void InitializeSystemSkinPaint()
Overrides
OnClick(EventArgs)
Handles the click event and manages the toggle logic for radio buttons. Radio buttons only respond to left mouse clicks and only toggle when they are currently unchecked.
Declaration
protected override void OnClick(EventArgs e)
Parameters
System.EventArgs
e
An System.EventArgs that contains the event data. |
Overrides
OnMouseDown(MouseEventArgs)
Handles the mouse down event and manages click mode behavior including hover and press modes. This method controls when the radio button responds to mouse interactions based on the configured click mode.
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
A System.Windows.Forms.MouseEventArgs that contains the event data. |
Overrides
OnMouseEnter(EventArgs)
Handles the mouse enter event and manages the pressed state for hover click mode. When hover click mode is enabled, this method sets the pressed state when the mouse enters the radio button area.
Declaration
protected override void OnMouseEnter(EventArgs e)
Parameters
System.EventArgs
e
An System.EventArgs that contains the event data. |
Overrides
OnMouseLeave(EventArgs)
Handles the mouse leave event and manages the click behavior for hover click mode. When hover click mode is enabled and the radio button is pressed, this method triggers the click action when the mouse leaves the area.
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
System.EventArgs
e
An System.EventArgs that contains the event data. |
Overrides
OnMouseUp(MouseEventArgs)
Handles the mouse up event and manages the pressed state for different click modes. This method controls the visual pressed state and capture behavior when the mouse button is released.
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
A System.Windows.Forms.MouseEventArgs that contains the event data. |
Overrides
OnToggle()
Performs the toggle operation when AutoCheck is enabled. This method is called internally when the radio button needs to change its checked state.
Declaration
protected override void OnToggle()
Overrides
OnToggleStateChanged(StateChangedEventArgs)
Handles the toggle state changed event and manages the mutually exclusive behavior for radio button groups. When AutoCheck is enabled and this radio button becomes checked, all other radio buttons in the same group are automatically unchecked.
Declaration
protected override void OnToggleStateChanged(StateChangedEventArgs e)
Parameters
StateChangedEventArgs
e
A StateChangedEventArgs that contains the event data. |
Overrides
ShouldPaintChild(RadElement)
Determines whether a specific child element should be painted based on the system skin settings. When system skin painting is enabled, this method controls which elements participate in the rendering process.
Declaration
protected override bool ShouldPaintChild(RadElement element)
Parameters
RadElement
element
The child RadElement to evaluate for painting. |
Returns
System.Boolean
true if the element should be painted; otherwise, false. |