Class RadButtonBase
Represents a base button control. The button control serves as a RadButtonElement wrapper. All logic and presentation features are implemented in a parallel hierarchy of objects. For this reason, RadButtonElement may be nested in any other telerik control, item, or element.
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadButtonBase : RadControl, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IPCHost, IAnalyticsProvider
Constructors
RadButtonBase()
Initializes a new instance of the RadButtonBase class.
Declaration
public RadButtonBase()
Properties
AllowShowFocusCues
Indicates focus cues display, when available, based on the corresponding control type and the current UI state.
Declaration
public override bool AllowShowFocusCues { get; set; }
Property Value
|
System.Boolean
|
Overrides
ButtonElement
Gets the instance of RadButtonElement wrapped by this control. RadButtonElement is the main element in the hierarchy tree and encapsulates the actual functionality of RadButton.
Declaration
public RadButtonElement ButtonElement { get; }
Property Value
|
RadButtonElement
|
DefaultSize
Gets the default size for the button control, which is 110 pixels wide by 24 pixels high.
Declaration
protected override Size DefaultSize { get; }
Property Value
|
System.Drawing.Size
|
DefaultTextAlignment
Gets the default text alignment for the button element by retrieving the value from the button element's metadata or override settings.
Declaration
protected virtual ContentAlignment DefaultTextAlignment { get; }
Property Value
|
System.Drawing.ContentAlignment
|
DisplayStyle
Specifies the options for display of image and text primitives in the element.
Declaration
[RadDefaultValue("DisplayStyle", typeof(RadButtonElement))]
public DisplayStyle DisplayStyle { get; set; }
Property Value
|
DisplayStyle
|
Font
Gets or sets the Font of the control. This actually the Font property of the root element. Setting to [null] resets the value and the font from the applied theme will be used.
Declaration
public override Font Font { get; set; }
Property Value
|
System.Drawing.Font
|
Overrides
Image
Declaration
[RadDescription("Image", typeof(RadButtonElement))]
public Image Image { get; set; }
Property Value
|
System.Drawing.Image
|
ImageAlignment
Gets or sets the alignment of image content on the drawing surface.
Declaration
[RadDefaultValue("ImageAlignment", typeof(RadButtonElement))]
public ContentAlignment ImageAlignment { get; set; }
Property Value
|
System.Drawing.ContentAlignment
|
ImageIndex
Declaration
[RadDefaultValue("ImageIndex", typeof(RadButtonElement))]
[RadDescription("ImageIndex", typeof(RadButtonElement))]
public int ImageIndex { get; set; }
Property Value
|
System.Int32
|
ImageKey
Declaration
[RadDefaultValue("ImageKey", typeof(RadButtonElement))]
[RadDescription("ImageKey", typeof(RadButtonElement))]
public string ImageKey { get; set; }
Property Value
|
System.String
|
MeasureTrailingSpaces
Includes the trailing space at the end of each line. By default the boundary rectangle returned by the Overload:System.Drawing.Graphics.MeasureString method excludes the space at the end of each line. Set this flag to include that space in measurement.
Declaration
public bool MeasureTrailingSpaces { get; set; }
Property Value
|
System.Boolean
|
SvgImage
Gets or sets the Svg Image.
Declaration
public RadSvgImage SvgImage { get; set; }
Property Value
|
RadSvgImage
|
SvgImageXml
This property is not relevant for this class as it's used internally for serialization purposes only.
Declaration
public string SvgImageXml { get; set; }
Property Value
|
System.String
|
Text
Gets or sets the text associated with this item.
Declaration
public override string Text { get; set; }
Property Value
|
System.String
|
Overrides
TextAlignment
Gets or sets the alignment of text content on the drawing surface.
Declaration
public ContentAlignment TextAlignment { get; set; }
Property Value
|
System.Drawing.ContentAlignment
|
TextImageRelation
Gets or sets the position of text and image relative to each other.
Declaration
[RadDefaultValue("TextImageRelation", typeof(RadButtonElement))]
public TextImageRelation TextImageRelation { get; set; }
Property Value
|
System.Windows.Forms.TextImageRelation
|
TextWrap
Declaration
[RadPropertyDefaultValue("TextWrap", typeof(TextPrimitive))]
public bool TextWrap { get; set; }
Property Value
|
System.Boolean
|
UseMnemonic
Determines whether the button can be clicked by using mnemonic characters.
Declaration
public bool UseMnemonic { get; set; }
Property Value
|
System.Boolean
|
Methods
ControlDefinesThemeForElement(RadElement)
Determines whether this control defines the theme for the specified element. Returns true for RadButtonElement instances.
Declaration
public override bool ControlDefinesThemeForElement(RadElement element)
Parameters
|
RadElement
element
The RadElement 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 instance for the button control to support assistive technologies and screen readers.
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
|
System.Windows.Forms.AccessibleObject
An System.Windows.Forms.AccessibleObject that provides accessibility support for the button control. |
CreateButtonElement()
Override this method to create custom main element. By default the main element is an instance of RadButtonElement.
Declaration
protected virtual RadButtonElement CreateButtonElement()
Returns
|
RadButtonElement
Instance of the one-and-only child of the root element of RadButton. |
CreateChildItems(RadElement)
Creates the child elements for the button control, specifically the main RadButtonElement and sets up event handling.
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
|
RadElement
parent
The parent RadElement to which the child elements will be added. |
Overrides
InitializeRootElement(RootRadElement)
Initializes the root element and configures focus cues behavior to allow display when the OS supports focus indicators for buttons.
Declaration
protected override void InitializeRootElement(RootRadElement rootElement)
Parameters
|
RootRadElement
rootElement
The root RootRadElement to initialize. |
Overrides
OnClick(EventArgs)
Handles the Click event. This method is intentionally empty as click handling is delegated to the button element.
Declaration
protected override void OnClick(EventArgs e)
Parameters
|
System.EventArgs
e
The System.EventArgs containing event data. |
Overrides
OnGotFocus(EventArgs)
Handles the GotFocus event by calling the base implementation and setting focus to the button element.
Declaration
protected override void OnGotFocus(EventArgs e)
Parameters
|
System.EventArgs
e
The System.EventArgs containing event data. |
Overrides
PerformClick()
Programmatically performs a button click by validating the currently active control and triggering the click event if the button is enabled.
Declaration
public virtual void PerformClick()
ProcessMnemonic(Char)
Processes mnemonic characters for the button, performing a click if the mnemonic character matches and the Alt key is pressed.
Declaration
protected override bool ProcessMnemonic(char charCode)
Parameters
|
System.Char
charCode
The character code of the mnemonic character to process. |
Returns
|
System.Boolean
True if the mnemonic was processed and handled; otherwise, false. |
Overrides
Events
DoubleClick
Declaration
public event EventHandler DoubleClick
Event Type
|
System.EventHandler
|
MouseDoubleClick
Declaration
public event MouseEventHandler MouseDoubleClick
Event Type
|
System.Windows.Forms.MouseEventHandler
|