Class RadCheckBox
Represents a checkbox control that allows users to select or deselect an option. Inherits from RadToggleButton and wraps the RadCheckBoxElement for functionality.
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadCheckBox : RadToggleButton, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IPCHost, IAnalyticsProvider, ISupportRootUIAutomation
Constructors
RadCheckBox()
Initializes a new instance of the RadCheckBox class. Creates a checkbox control with default settings and enables automatic sizing.
Declaration
public RadCheckBox()
Properties
AutoSize
Gets or sets a value indicating whether the control is automatically resized to display its entire contents. This property is enabled by default for checkbox controls to ensure proper text display.
Declaration
public override bool AutoSize { get; set; }
Property Value
System.Boolean
|
Overrides
ButtonElement
Gets the RadCheckBoxElement instance wrapped by this control. This element encapsulates the actual functionality and visual representation of the checkbox.
Declaration
public RadCheckBoxElement ButtonElement { get; }
Property Value
RadCheckBoxElement
|
CheckAlignment
Gets or sets the alignment of the checkbox mark relative to the text content.
Declaration
[RadPropertyDefaultValue("CheckAlignment", typeof(RadCheckBoxElement))]
[RadDescription("CheckAlignment", typeof(RadCheckBoxElement))]
public ContentAlignment CheckAlignment { get; set; }
Property Value
System.Drawing.ContentAlignment
|
Checked
Gets or sets a value indicating the checked state of the checkbox. This property provides compatibility with standard checkbox controls and maps to the toggle state functionality.
Declaration
public bool Checked { get; set; }
Property Value
System.Boolean
|
DefaultSize
Gets the default size of the checkbox control when no explicit size is specified.
Declaration
protected override Size DefaultSize { get; }
Property Value
System.Drawing.Size
|
Overrides
Font
Gets or sets the font used to display text in the checkbox control. This property affects both the control and its underlying button element.
Declaration
public override Font Font { get; set; }
Property Value
System.Drawing.Font
|
Overrides
IsChecked
This property is not relevant for this class.
Declaration
public override bool IsChecked { get; set; }
Property Value
System.Boolean
|
Overrides
UseMnemonic
Gets or sets a value indicating whether mnemonics are used for keyboard navigation. When enabled, users can activate the checkbox using Alt + the mnemonic character.
Declaration
public bool UseMnemonic { get; set; }
Property Value
System.Boolean
|
Methods
ButtonElement_ToggleStateChanged(Object, StateChangedEventArgs)
Handles the toggle state changed event from the underlying button element and notifies about property changes.
Declaration
protected override void ButtonElement_ToggleStateChanged(object sender, StateChangedEventArgs args)
Parameters
System.Object
sender
The source of the event |
StateChangedEventArgs
args
The StateChangedEventArgs containing event data |
Overrides
ButtonElement_ToggleStateChanging(Object, StateChangingEventArgs)
Handles the toggle state changing event from the underlying button element.
Declaration
protected override void ButtonElement_ToggleStateChanging(object sender, StateChangingEventArgs args)
Parameters
System.Object
sender
The source of the event |
StateChangingEventArgs
args
The StateChangingEventArgs containing event data |
Overrides
ControlDefinesThemeForElement(RadElement)
Determines whether the control defines theme settings for the specified element. This method is used by the theming infrastructure to apply appropriate themes to child elements.
Declaration
public override bool ControlDefinesThemeForElement(RadElement element)
Parameters
RadElement
element
The element to check for theme definition. |
Returns
System.Boolean
true if this control defines the theme for the element; otherwise, false. |
Overrides
CreateAccessibilityInstance()
Creates an accessibility object for the checkbox control to support screen readers and accessibility tools.
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
System.Windows.Forms.AccessibleObject
A new accessibility object instance if accessibility is enabled; otherwise, the base accessibility object |
Overrides
CreateButtonElement()
Creates the main button element specific for RadCheckBox functionality.
Declaration
protected override RadButtonElement CreateButtonElement()
Returns
RadButtonElement
A new instance of RadCheckBoxElement that encapsulates the checkbox functionality |
Overrides
OnThemeChanged()
Handles theme change events and applies Material theme specific settings if applicable.
Declaration
protected override void OnThemeChanged()
Overrides
res_CheckStateChanged(Object, EventArgs)
Handles the check state changed event and raises the appropriate event.
Declaration
protected override void res_CheckStateChanged(object sender, EventArgs e)
Parameters
System.Object
sender
The source of the event |
System.EventArgs
e
The System.EventArgs containing event data |
Overrides
res_CheckStateChanging(Object, CheckStateChangingEventArgs)
Handles the check state changing event and raises the appropriate event.
Declaration
protected override void res_CheckStateChanging(object sender, CheckStateChangingEventArgs args)
Parameters
System.Object
sender
The source of the event |
CheckStateChangingEventArgs
args
The CheckStateChangingEventArgs containing event data |
Overrides
res_PropertyChanged(Object, PropertyChangedEventArgs)
Handles property changed events and notifies about IsChecked property changes.
Declaration
protected override void res_PropertyChanged(object sender, PropertyChangedEventArgs e)
Parameters
System.Object
sender
The source of the event |
System.ComponentModel.PropertyChangedEventArgs
e
The System.ComponentModel.PropertyChangedEventArgs containing event data |
Overrides
SetBackColorThemeOverrides()
Sets theme overrides for the BackColor property across all visual states of the button element.
Declaration
protected override void SetBackColorThemeOverrides()