Class RadLabelElement
Represents a label element that displays text, images, and various content alignment options with comprehensive layout and styling capabilities.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadLabelElement : RadItem, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode
Constructors
RadLabelElement()
Declaration
public RadLabelElement()
Fields
BorderVisibleProperty
Identifies the BorderVisible dependency property that controls border visibility.
Declaration
public static RadProperty BorderVisibleProperty
Field Value
RadProperty
|
DisplayStyleProperty
Identifies the DisplayStyle dependency property.
Declaration
public static RadProperty DisplayStyleProperty
Field Value
RadProperty
|
ImageAlignmentProperty
Identifies the ImageAlignment dependency property that controls image positioning within the element.
Declaration
public static RadProperty ImageAlignmentProperty
Field Value
RadProperty
|
ImageIndexProperty
Identifies the ImageIndex dependency property.
Declaration
public static RadProperty ImageIndexProperty
Field Value
RadProperty
|
ImageKeyProperty
Identifies the ImageKey dependency property.
Declaration
public static RadProperty ImageKeyProperty
Field Value
RadProperty
|
ImageProperty
Identifies the Image dependency property for raster image content.
Declaration
public static RadProperty ImageProperty
Field Value
RadProperty
|
SvgImageProperty
Identifies the SvgImage dependency property for vector image content.
Declaration
public static RadProperty SvgImageProperty
Field Value
RadProperty
|
TextAlignmentProperty
Identifies the TextAlignment dependency property that controls text positioning within the element.
Declaration
public static RadProperty TextAlignmentProperty
Field Value
RadProperty
|
TextImageRelationProperty
Identifies the TextImageRelation dependency property that defines the spatial relationship between text and image elements.
Declaration
public static RadProperty TextImageRelationProperty
Field Value
RadProperty
|
Properties
BorderVisible
Gets or sets a value indicating whether the border around the label element is visible.
Declaration
[RadPropertyDefaultValue("BorderVisible", typeof(RadLabelElement))]
public bool BorderVisible { get; set; }
Property Value
System.Boolean
|
Image
Gets or sets the raster image that is displayed in the label element.
Declaration
[RadPropertyDefaultValue("Image", typeof(RadLabelElement))]
public virtual Image Image { get; set; }
Property Value
System.Drawing.Image
|
ImageAlignment
Gets or sets the alignment of image content within the label element's boundaries.
Declaration
[RadPropertyDefaultValue("ImageAlignment", typeof(RadLabelElement))]
public virtual ContentAlignment ImageAlignment { get; set; }
Property Value
System.Drawing.ContentAlignment
|
ImageIndex
Gets or sets the image list index value of the image displayed in the label element.
Declaration
[RadPropertyDefaultValue("ImageIndex", typeof(RadLabelElement))]
public virtual int ImageIndex { get; set; }
Property Value
System.Int32
|
ImageKey
Gets or sets the key accessor for the image in the associated ImageList.
Declaration
[RadPropertyDefaultValue("ImageKey", typeof(RadLabelElement))]
public virtual string ImageKey { get; set; }
Property Value
System.String
|
LabelBorder
Gets the border primitive element responsible for rendering the border around the label.
Declaration
public BorderPrimitive LabelBorder { get; }
Property Value
BorderPrimitive
|
LabelFill
Gets the fill primitive element responsible for painting the background fill of the label.
Declaration
public FillPrimitive LabelFill { get; }
Property Value
FillPrimitive
|
LabelImage
Gets the image primitive element responsible for rendering the image of the label.
Declaration
public ImagePrimitive LabelImage { get; }
Property Value
ImagePrimitive
|
LabelText
Gets the text primitive element responsible for rendering the text in the label.
Declaration
public TextPrimitive LabelText { get; }
Property Value
TextPrimitive
|
SvgImage
Gets or sets the vector image that is displayed in the label element.
Declaration
[RadPropertyDefaultValue("SvgImage", typeof(RadButtonItem))]
public RadSvgImage SvgImage { get; set; }
Property Value
RadSvgImage
|
SvgImageXml
Gets or sets the SVG image as an XML string representation.
Declaration
public string SvgImageXml { get; set; }
Property Value
System.String
|
TextAlignment
Gets or sets the alignment of text content within the label element's boundaries.
Declaration
[RadPropertyDefaultValue("TextAlignment", typeof(RadLabelElement))]
public virtual ContentAlignment TextAlignment { get; set; }
Property Value
System.Drawing.ContentAlignment
|
TextImageRelation
Gets or sets the spatial relationship between text and image content within the label element.
Declaration
[RadPropertyDefaultValue("TextImageRelation", typeof(RadLabelElement))]
public virtual TextImageRelation TextImageRelation { get; set; }
Property Value
System.Windows.Forms.TextImageRelation
|
TextWrap
Gets or sets a value indicating whether the text should wrap to fit within the available layout rectangle.
Declaration
[RadPropertyDefaultValue("TextWrap", typeof(TextPrimitive))]
public bool TextWrap { get; set; }
Property Value
System.Boolean
|
UseMnemonic
Gets or sets a value indicating whether the text can contain keyboard mnemonics indicated by an ampersand character.
Declaration
[RadDefaultValue("UseMnemonic", typeof(TextPrimitive))]
[RadDescription("UseMnemonic", typeof(TextPrimitive))]
public bool UseMnemonic { get; set; }
Property Value
System.Boolean
|
Methods
CreateChildElements()
Creates the child elements that comprise the label including border, fill, text, and image primitives.
Declaration
protected override void CreateChildElements()
Overrides
MeasureOverride(SizeF)
Measures the desired size of the label element within the specified available size constraints.
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
System.Drawing.SizeF
availableSize
The available space that the parent element can allocate to this element. |
Returns
System.Drawing.SizeF
The desired size of the element based on its content and layout requirements. |
Overrides
OnPropertyChanged(RadPropertyChangedEventArgs)
Handles property changes and updates related elements accordingly.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
RadPropertyChangedEventArgs
e
The event arguments containing information about the changed property. |
Overrides
ShouldSerializeProperty(PropertyDescriptor)
Determines whether the specified property should be serialized based on its value source and current state.
Declaration
public override bool? ShouldSerializeProperty(PropertyDescriptor property)
Parameters
System.ComponentModel.PropertyDescriptor
property
The property descriptor to evaluate for serialization. |
Returns
System.Nullable<System.Boolean>
True if the property should be serialized; otherwise, false. |