RadButtonElement
Represents a button element. The button element could be placed in each control's Items collection. It encapsulates all the necessary logic related to the user interaction and UI. The RadButton class is a simple wrapper for the RadButtonElement class. The RadButton acts to transfer events to and from its corresponding RadButtonElement instance. The RadButtonElement which is essentially the RadButton control may be nested in other telerik controls.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[ComVisible(false)]
public class RadButtonElement : RadButtonItem, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IButtonControl, IImageElement
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemRadButtonItemRadButtonElement...
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadButtonElement class.
public RadButtonElement()
Initializes a new instance of the RadButtonElement class with the specified text.
public RadButtonElement(string text)
The text to display on the button element.
Fields
Identifies the LargeImageIndex property.
public static RadProperty LargeImageIndexProperty
Identifies the LargeImageKey property.
public static RadProperty LargeImageKeyProperty
Identifies the LargeImage property.
public static RadProperty LargeImageProperty
Identifies the SmallImageIndex property.
public static RadProperty SmallImageIndexProperty
Identifies the SmallImageKey property.
public static RadProperty SmallImageKeyProperty
Identifies the SmallImage property.
public static RadProperty SmallImageProperty
Identifies the UseSmallImageList property.
public static RadProperty UseSmallImageListProperty
Properties
Gets or sets the BorderPrimitive element that is responsible for painting the border of the button control.
[Browsable(true)]
public BorderPrimitive BorderElement { get; protected set; }
Gets or sets the FillPrimitive element that is responsible for painting the background of the button control.
[Browsable(true)]
public FillPrimitive ButtonFillElement { get; protected set; }
Gets a reference to the FocusPrimitive element that handles focus indication for the RadButtonElement.
[Browsable(false)]
public FocusPrimitive FocusPrimitive { get; }
Gets or sets a reference to the ImagePrimitive element that handles image rendering for the RadButtonElement.
[Browsable(false)]
public ImagePrimitive ImagePrimitive { get; protected set; }
Gets or sets the angle of rotation for the button image in degrees. Unlike AngleTransform, the ImagePrimitiveAngleTransform property rotates only the image element, not the entire button.
public float ImagePrimitiveAngleTransform { get; set; }
Gets the large image that is displayed on the button element. This property is read-only and retrieves the image from the associated ImageList.
[Browsable(false)]
[TypeConverter(typeof(ImageTypeConverter))]
public virtual Image LargeImage { get; }
Gets the large image list index value of the image displayed on the button control. This property is read-only and represents the index in the associated large ImageList.
[Browsable(false)]
[RelatedImageList("ElementTree.Control.ImageList")]
[TypeConverter("Telerik.WinControls.UI.Design.NoneExcludedImageIndexConverter, Telerik.WinControls.UI.Design, Version=2026.2.702.48, Culture=neutral, PublicKeyToken=5bb2a467cbec794e")]
public virtual int LargeImageIndex { get; }
Gets the large key accessor for the image in the ImageList. This property is read-only and represents the string key used to identify the image in the associated large ImageList.
[Browsable(false)]
[TypeConverter("Telerik.WinControls.UI.Design.RadImageKeyConverter, Telerik.WinControls.UI.Design, Version=2026.2.702.48, Culture=neutral, PublicKeyToken=5bb2a467cbec794e")]
public virtual string LargeImageKey { get; }
Gets or sets a reference to the ImageAndTextLayoutPanel that manages the layout and positioning of image and text elements within the button.
[Browsable(false)]
public ImageAndTextLayoutPanel LayoutPanel { get; protected set; }
Gets or sets a value indicating whether trailing spaces at the end of each line should be included in text measurement. By default, the Graphics.MeasureString method excludes trailing spaces. Setting this to true includes that space in measurement calculations.
public bool MeasureTrailingSpaces { get; set; }
Gets or sets a value indicating whether the border is visible around the button. When true, the border is displayed; when false, the border is collapsed and not visible.
[Browsable(true)]
public bool ShowBorder { get; set; }
Gets or sets the small image that is displayed on the button element. This property allows direct assignment of an Image object to be displayed.
[TypeConverter(typeof(ImageTypeConverter))]
public virtual Image SmallImage { get; set; }
Gets or sets the small image list index value of the image displayed on the button control. This property specifies the index of the image in the associated small ImageList.
[RelatedImageList("ElementTree.Control.SmallImageList")]
[TypeConverter("Telerik.WinControls.UI.Design.NoneExcludedImageIndexConverter, Telerik.WinControls.UI.Design, Version=2026.2.702.48, Culture=neutral, PublicKeyToken=5bb2a467cbec794e")]
public virtual int SmallImageIndex { get; set; }
Gets or sets the small key accessor for the image in the ImageList. This property specifies the string key used to identify the image in the associated small ImageList.
[RelatedImageList("ElementTree.Control.SmallImageList")]
[TypeConverter("Telerik.WinControls.UI.Design.RadImageKeyConverter, Telerik.WinControls.UI.Design, Version=2026.2.702.48, Culture=neutral, PublicKeyToken=5bb2a467cbec794e")]
public virtual string SmallImageKey { get; set; }
Gets or sets the TextPrimitive element that is responsible for rendering the text content of the button control.
[Browsable(true)]
public TextPrimitive TextElement { get; protected set; }
Gets or sets a value indicating whether the text should wrap to the available layout rectangle. When true, text will wrap to multiple lines within the button's bounds; when false, text remains on a single line.
public bool TextWrap { get; set; }
Gets or sets a value indicating whether the button should use the small image list instead of the original image list. When set to true, images are retrieved from the SmallImageList; when false, images are retrieved from the standard ImageList.
[Browsable(false)]
public virtual bool UseSmallImageList { get; set; }
Methods
Creates the child elements that compose the button structure including fill, border, text, image, layout panel, and focus primitives. This method establishes the visual hierarchy and property bindings between the child elements.
protected override void CreateChildElements()
Overrides:
Gets the appropriate VisualStyleElement based on the current button state.
public override VisualStyleElement GetVistaVisualStyle()
A VisualStyleElement that represents the current visual state of the button.
Overrides:
Initializes the fields of the RadButtonElement.
protected override void InitializeFields()
Overrides:
Initializes system skin painting by updating text color to match system theme requirements. This method configures the text primitive's foreground color based on the current system skin manager settings.
protected override void InitializeSystemSkinPaint()
Overrides:
Measures the child elements of the button and calculates the total required size based on AutoSize behavior and layout constraints.
Measures the desired size of the button element within the given available space constraints.
Handles the click event for the button element. This method ensures only left mouse button clicks are processed.
protected override void OnClick(EventArgs e)
The event arguments containing information about the click event.
Overrides:
Determines whether a specific child element should be painted when system skin rendering is enabled.
protected override bool ShouldPaintChild(RadElement element)
The child element to evaluate for painting.
Returns:True if the element should be painted; false if it should be skipped during the paint operation.
Overrides: