Class
TextPrimitive

Represents a primitive element that renders text content with advanced formatting, layout, and styling capabilities.

Definition

Namespace:Telerik.WinControls.Primitives

Assembly:Telerik.WinControls.dll

Syntax:

cs-api-definition
public class TextPrimitive : BasePrimitive, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, IPrimitive, ITextProvider, ITextPrimitive

Inheritance: objectDisposableObjectRadObjectRadElementVisualElementBasePrimitiveTextPrimitive

Derived Classes: TitleBarTextPrimitive

Implements: ICustomTypeDescriptorIDisposableINotifyPropertyChangedIPrimitiveIStylableNodeISupportSystemSkinITextPrimitiveITextProvider

Inherited Members BasePrimitive.BoxCategoryBasePrimitive.PaintElement(IGraphics, float, SizeF)VisualElement.DefaultSizePropertyVisualElement.ForeColorPropertyVisualElement.BackColorPropertyVisualElement.FontPropertyVisualElement.SmoothingModePropertyVisualElement.OpacityPropertyVisualElement.CustomFontPropertyVisualElement.CustomFontSizePropertyVisualElement.CustomFontStylePropertyVisualElement.OnFontChanged(EventArgs)VisualElement.OnPropertyChanging(RadPropertyChangingEventArgs)VisualElement.PaintChildren(IGraphics, Rectangle, float, SizeF, bool)VisualElement.PrePaintElement(IGraphics)VisualElement.PostPaintElement(IGraphics)VisualElement.GetScaledFont(float)VisualElement.GetScaledFont(float, Font)VisualElement.DefaultSizeVisualElement.ForeColorVisualElement.BackColorVisualElement.FontVisualElement.CustomFontVisualElement.CustomFontSizeVisualElement.CustomFontStyleVisualElement.SmoothingModeVisualElement.OpacityVisualElement.FontChangedRadElement.BoundsPropertyRadElement.BorderThicknessPropertyRadElement.PaddingPropertyRadElement.MarginPropertyRadElement.AlignmentPropertyRadElement.AutoSizeModePropertyRadElement.FitToSizeModePropertyRadElement.MinSizePropertyRadElement.EnabledPropertyRadElement.CanFocusPropertyRadElement.IsItemFocusedPropertyRadElement.IsFocusedPropertyRadElement.IsMouseOverPropertyRadElement.IsMouseOverElementPropertyRadElement.IsMouseDownPropertyRadElement.ShouldPaintPropertyRadElement.VisibilityPropertyRadElement.NamePropertyRadElement.ClassPropertyRadElement.ClipDrawingPropertyRadElement.ShapePropertyRadElement.MouseClickedEventRadElement.MouseDoubleClickedEventRadElement.MouseDownEventRadElement.MouseUpEventRadElement.MouseWheelEventRadElement.ChildElementAddedEventRadElement.ParentChangedEventRadElement.BoundsChangedEventRadElement.VisibilityChangingEventRadElement.EnabledChangedEventRadElement.ControlChangedEventRadElement.BackgroundShapePropertyRadElement.BackgroundShapePaintModePropertyRadElement.ContainsFocusPropertyRadElement.ContainsMousePropertyRadElement.MaxSizePropertyRadElement.RightToLeftPropertyRadElement.AutoSizePropertyRadElement.ZIndexPropertyRadElement.AngleTransformPropertyRadElement.ScaleTransformPropertyRadElement.PositionOffsetPropertyRadElement.TagPropertyRadElement.StretchHorizontallyPropertyRadElement.StretchVerticallyPropertyRadElement.UseCompatibleTextRenderingPropertyRadElement.ClickModePropertyRadElement.styleVersionRadElement.paintSystemSkinRadElement.SetPropertyValueCommandRadElement.GetPropertyValueCommandRadElement.StylePropertyRadElement.CallCreateChildElements()RadElement.SuspendReferenceUpdate()RadElement.ResumeReferenceUpdate()RadElement.CreateChildElements()RadElement.OnLoad(bool)RadElement.LoadCore()RadElement.OnLoaded()RadElement.OnUnload(ComponentThemableElementTree, bool)RadElement.UnloadCore(ComponentThemableElementTree)RadElement.OnUnloaded(ComponentThemableElementTree)RadElement.OnElementTreeChanged(ComponentThemableElementTree)RadElement.OnBeginDispose()RadElement.SetParent(RadElement)RadElement.OnParentChanged(RadElement)RadElement.UpdateReferences(ComponentThemableElementTree, bool, bool)RadElement.ResetLayout(bool)RadElement.HasInvisibleAncestor()RadElement.ResetLayoutCore()RadElement.InvalidateArrange()RadElement.InvalidateArrange(bool)RadElement.InvalidateMeasure()RadElement.InvalidateMeasure(bool)RadElement.UpdateLayout()RadElement.SuspendLayout()RadElement.SuspendLayout(bool)RadElement.ResumeLayout(bool)RadElement.ResumeLayout(bool, bool)RadElement.Arrange(RectangleF)RadElement.Measure(SizeF)RadElement.SetBounds(Rectangle)RadElement.SetBounds(int, int, int, int)RadElement.GetBoundingRectangle(Size)RadElement.GetBoundingRectangle(Rectangle)RadElement.GetDesiredSize(bool)RadElement.PointToScreen(Point)RadElement.PointFromScreen(Point)RadElement.PointToControl(Point)RadElement.PointFromControl(Point)RadElement.LocationToControl()RadElement.RectangleToScreen(Rectangle)RadElement.HitTest(Point)RadElement.OnRenderSizeChanged(SizeChangedInfo)RadElement.OnChildDesiredSizeChanged(RadElement)RadElement.OnLayoutPropertyChanged(RadPropertyChangedEventArgs)RadElement.MeasureCore(SizeF)RadElement.ShouldArrangeChild(RadElement)RadElement.ShouldMeasureChild(RadElement)RadElement.MeasureChildren(SizeF)RadElement.GetArrangeRect(RectangleF)RadElement.CanExecuteLayoutOperation()RadElement.CalcLayoutOffset(PointF)RadElement.LockBounds()RadElement.UnlockBounds()RadElement.SetBoundsCore(Rectangle)RadElement.IsInValidState(bool)RadElement.Invalidate()RadElement.Invalidate(bool)RadElement.GetInvalidateBounds()RadElement.NotifyInvalidate(RadElement)RadElement.OnTransformationInvalidated()RadElement.PerformLayoutTransformation(ref RadMatrix)RadElement.PerformPaintTransformation(ref RadMatrix)RadElement.IsInGetAsBitmap()RadElement.PaintElementSkin(IGraphics)RadElement.PaintOverride(IGraphics, Rectangle, float, SizeF, bool)RadElement.PaintBackgroundShape(IGraphics)RadElement.PostPaintChildren(IGraphics, Rectangle, float, SizeF)RadElement.PaintChild(RadElement, IGraphics, Rectangle, float, SizeF, bool)RadElement.PaintShadow(RadElement, IGraphics)RadElement.PaintShadowCore(Graphics, Rectangle, RadItem)RadElement.GetShadowRect(ref Rectangle, int)RadElement.PaintFocusCues(IGraphics, Rectangle)RadElement.GetAsBitmap(IGraphics, Brush, float, SizeF)RadElement.GetAsTransformedBitmap(IGraphics, Brush, float, SizeF)RadElement.GetAsTransformedBitmap(Brush, float, SizeF)RadElement.GetAsTransformedBitmap(Rectangle, Brush, float, SizeF)RadElement.GetAsBitmapEx(Color, float, SizeF)RadElement.GetAsBitmapEx(Brush, float, SizeF)RadElement.GetAsBitmap(Brush, float, SizeF)RadElement.IsInVisibleClipBounds(Rectangle)RadElement.SetClipping(Graphics)RadElement.GetClipRect()RadElement.ShouldPaintChild(RadElement)RadElement.GetFocusRect()RadElement.GetCurrentShape()RadElement.GetPaintRectangle(float, float, SizeF)RadElement.GetPatchedRect(RectangleF, float, SizeF)RadElement.GetXPVisualStyle()RadElement.GetVistaVisualStyle()RadElement.InitializeSystemSkinPaint()RadElement.UnitializeSystemSkinPaint()RadElement.GetSystemSkinPaintBounds()RadElement.OnUseSystemSkinChanged(EventArgs)RadElement.ShouldPaintSystemSkin()RadElement.ComposeShouldPaintSystemSkin()RadElement.ResetStyleSettings(bool)RadElement.ResetStyleSettings(bool, RadProperty)RadElement.ProcessBehaviors(RadPropertyChangedEventArgs)RadElement.AddBehavior(PropertyChangeBehavior)RadElement.GetBehaviors()RadElement.RemoveBehavior(PropertyChangeBehavior)RadElement.ClearBehaviors()RadElement.AddRangeBehavior(PropertyChangeBehaviorCollection)RadElement.SetThemeApplied(bool)RadElement.OnStyleChanged(RadPropertyChangedEventArgs)RadElement.UnapplyStyle()RadElement.RemoveRangeBehaviors(PropertyChangeBehaviorCollection)RadElement.RemoveBehaviors(PropertyChangeBehavior)RadElement.RemoveRangeRoutedEventBehaviors(RoutedEventBehaviorCollection)RadElement.GetThemeEffectiveType()RadElement.GetChildrenByType(Type)RadElement.GetChildrenByBaseType(Type)RadElement.FindAncestorByThemeEffectiveType(Type)RadElement.FindAncestor<T>()RadElement.IsAncestorOf(RadElement)RadElement.FindDescendant<T>()RadElement.FindDescendant(Predicate<RadElement>)RadElement.FindDescendant(Type)RadElement.EnumDescendants(TreeTraversalMode)RadElement.EnumDescendants(Predicate<RadElement>, TreeTraversalMode)RadElement.EnumDescendants(Filter, TreeTraversalMode)RadElement.GetDescendants(Predicate<RadElement>, TreeTraversalMode)RadElement.GetDescendants(Filter, TreeTraversalMode)RadElement.GetAncestors(Filter)RadElement.GetAncestors(Predicate<RadElement>)RadElement.RaiseRoutedEvent(RadElement, RoutedEventArgs)RadElement.RaiseTunnelEvent(RadElement, RoutedEventArgs)RadElement.RaiseBubbleEvent(RadElement, RoutedEventArgs)RadElement.OnTunnelEvent(RadElement, RoutedEventArgs)RadElement.OnBubbleEvent(RadElement, RoutedEventArgs)RadElement.IsEventInProcess(RaisedRoutedEvent)RadElement.RegisterRoutedEvent(string, Type)RadElement.GetRegisterRoutedEvent(string, Type)RadElement.GetRegisterRoutedEvent(string, string)RadElement.GetRegisterRoutedEvent(string)RadElement.OnChildrenChanged(RadElement, ItemsChangeOperation)RadElement.GetChildren(ChildrenListOptions)RadElement.SendToBack()RadElement.BringToFront()RadElement.IsChildOf(RadElement)RadElement.Focus()RadElement.Focus(bool)RadElement.SetFocusPropertySafe(bool)RadElement.KillFocus()RadElement.OnCLREventsRise(RoutedEventArgs)RadElement.OnMouseHover(EventArgs)RadElement.OnEnabledChanged(RadPropertyChangedEventArgs)RadElement.OnParentEnabledChanged(RadPropertyChangedEventArgs)RadElement.OnMouseDown(MouseEventArgs)RadElement.OnMouseUp(MouseEventArgs)RadElement.OnLostMouseCapture(MouseEventArgs)RadElement.OnClick(EventArgs)RadElement.OnDoubleClick(EventArgs)RadElement.OnMouseEnter(EventArgs)RadElement.OnMouseLeave(EventArgs)RadElement.PerformClick()RadElement.OnMouseWheel(MouseEventArgs)RadElement.DoMouseWheel(MouseEventArgs)RadElement.DoClick(EventArgs)RadElement.DoDoubleClick(EventArgs)RadElement.IsInputKey(InputKeyEventArgs)RadElement.MouseEventArgsFromControl(MouseEventArgs)RadElement.DoMouseDown(MouseEventArgs)RadElement.DoMouseUp(MouseEventArgs)RadElement.DoMouseMove(MouseEventArgs)RadElement.ShowScreenTip(ScreenTipNeededEventArgs)RadElement.HideScreenTip()RadElement.DoMouseHover(EventArgs)RadElement.OnShowScreenTip(ComponentInputBehavior)RadElement.RaiseClick(EventArgs)RadElement.RaiseDoubleClick(EventArgs)RadElement.RaiseMouseWheel(MouseEventArgs)RadElement.UpdateContainsFocus(bool)RadElement.DoMouseEnter(EventArgs)RadElement.DoMouseLeave(EventArgs)RadElement.GetValue(RadProperty)RadElement.AddStylePropertySetting(IPropertySetting)RadElement.SetValueCore(RadPropertyValue, object, object, ValueSource)RadElement.NotifyChildren(RadPropertyChangedEventArgs)RadElement.OnBoundsChanged(RadPropertyChangedEventArgs)RadElement.OnLocationChanged(RadPropertyChangedEventArgs)RadElement.OnDisplayPropertyChanged(RadPropertyChangedEventArgs)RadElement.CanRaisePropertyChangeNotifications(RadPropertyValue)RadElement.IsPropertyCancelable(RadPropertyMetadata)RadElement.OnParentPropertyChanged(RadPropertyChangedEventArgs)RadElement.ReplaceDefaultDescriptors(PropertyDescriptorCollection)RadElement.DisposeManagedResources()RadElement.PerformDispose(bool)RadElement.DisposeChildren()RadElement.GetStylableChildrenHierarchy()RadElement.GetStylableChildren()RadElement.GetClientRectangle(SizeF)RadElement.GetBorderThickness(BorderPrimitive)RadElement.DpiScaleChanged(SizeF)RadElement.ElementStateRadElement.DesiredSizeRadElement.IsLayoutSuspendedRadElement.BoundingRectangleRadElement.ControlBoundingRectangleRadElement.BypassLayoutPoliciesRadElement.IsArrangeValidRadElement.IsMeasureValidRadElement.TreeLevelRadElement.TransformRadElement.TotalTransformRadElement.ShouldPaintUsingParentShapeRadElement.UseSystemSkinRadElement.CanHaveOwnStyleRadElement.PropagateStyleToChildrenRadElement.ThemeEffectiveTypeRadElement.ElementTreeRadElement.ChildrenRadElement.ChildrenHierarchyRadElement.ParentRadElement.RoutedEventBehaviorsRadElement.LayoutableChildrenCountRadElement.ContainsFocusRadElement.ShouldHandleMouseInputRadElement.NotifyParentOnMouseInputRadElement.IsAbleToRespondToMouseEventsRadElement.AutoSizeRadElement.BoundsRadElement.LocationRadElement.SizeRadElement.BorderThicknessRadElement.PaddingRadElement.MarginRadElement.AlignmentRadElement.AutoSizeModeRadElement.FitToSizeModeRadElement.EnabledRadElement.CanFocusRadElement.IsFocusedRadElement.IsMouseOverRadElement.IsMouseOverElementRadElement.IsMouseDownRadElement.InvalidateChildrenOnChildChangedRadElement.ShouldPaintRadElement.VisibilityRadElement.IsElementVisibleRadElement.NameRadElement.ClassRadElement.ClipDrawingRadElement.ShapeRadElement.MinSizeRadElement.MaxSizeRadElement.ZIndexRadElement.RightToLeftRadElement.UseCompatibleTextRenderingRadElement.BackgroundShapeRadElement.BackgroundShapePaintModeRadElement.ContainsMouseRadElement.CaptureRadElement.ScaleTransformRadElement.AngleTransformRadElement.PositionOffsetRadElement.SerializePropertiesRadElement.SerializeElementRadElement.SerializeChildrenRadElement.RenderingMaxFramerateRadElement.IsThemeAppliedRadElement.ShouldApplyThemeRadElement.UseCenteredAngleTransformRadElement.TagRadElement.ClickModeRadElement.DoubleClickEnabledRadElement.CaptureOnMouseDownRadElement.IsItemHoveredRadElement.StyleRadElement.ToolTipTextRadElement.AutoToolTipRadElement.ScreenTipRadElement.AutoNumberKeyTipRadElement.DpiScaleFactorRadElement.LayoutUpdatedRadElement.MouseHoverRadElement.MouseMoveRadElement.MouseDownRadElement.MouseUpRadElement.ClickRadElement.DoubleClickRadElement.MouseEnterRadElement.MouseWheelRadElement.EnabledChangedRadElement.MouseLeaveRadElement.ChildrenChangedRadElement.LostMouseCaptureRadObject.BindingContextPropertyRadObject.RadTypeRadObject.ClearPropertyStore()RadObject.SuspendPropertyNotifications()RadObject.ResumePropertyNotifications()RadObject.GetPropertyValue(RadProperty)RadObject.SetDefaultValueOverride(RadProperty, object)RadObject.SetValue(RadProperty, object)RadObject.ResetValue(RadProperty)RadObject.ResetLocalValue(RadProperty)RadObject.ResetValue(RadProperty, ValueResetFlags)RadObject.UpdateValue(RadProperty)RadObject.GetValueSource(RadProperty)RadObject.GetRegisteredRadProperty(string)RadObject.UpdateValueCore(RadPropertyValue)RadObject.ResetValueCore(RadPropertyValue, ValueResetFlags)RadObject.GetDefaultValue(RadPropertyValue, object)RadObject.CoerceValue(RadPropertyValue, object)RadObject.ShouldSerializeProperty(RadProperty)RadObject.BindProperty(RadProperty, RadObject, RadProperty, PropertyBindingOptions)RadObject.UnbindProperty(RadProperty)RadObject.GetInheritedValue(RadProperty)RadObject.OnNotifyPropertyChanged(string)RadObject.OnNotifyPropertyChanged(PropertyChangedEventArgs)RadObject.OnShouldSerializeProperty(ShouldSerializePropertyEventArgs)RadObject.PropertyValuesRadObject.PropertyFilterRadObject.RadObjectTypeRadObject.BindingContextRadObject.PropertyChangedRadObject.RadPropertyChangedRadObject.RadPropertyChangingDisposableObject.GetBitState(long)DisposableObject.SetBitState(long, bool)DisposableObject.OnBitStateChanged(long, bool, bool)DisposableObject.Dispose()DisposableObject.Dispose(bool)DisposableObject.DisposeUnmanagedResources()DisposableObject.BitStateDisposableObject.EventsDisposableObject.IsDisposingDisposableObject.IsDisposedDisposableObject.DisposedDisposableObject.Disposing

Constructors

TextPrimitive()

Declaration

cs-api-definition
public TextPrimitive()

Fields

AutoEllipsisProperty

Declaration

cs-api-definition
public static RadProperty AutoEllipsisProperty

Field Value

RadProperty

DisabledTextRenderingHintProperty

Declaration

cs-api-definition
public static RadProperty DisabledTextRenderingHintProperty

Field Value

RadProperty

FlipTextProperty

Declaration

cs-api-definition
public static RadProperty FlipTextProperty

Field Value

RadProperty

LineLimitProperty

Declaration

cs-api-definition
public static RadProperty LineLimitProperty

Field Value

RadProperty

MeasureTrailingSpacesProperty

Declaration

cs-api-definition
public static RadProperty MeasureTrailingSpacesProperty

Field Value

RadProperty

ShadowProperty

Declaration

cs-api-definition
public static RadProperty ShadowProperty

Field Value

RadProperty

ShowKeyboardCuesProperty

Declaration

cs-api-definition
public static RadProperty ShowKeyboardCuesProperty

Field Value

RadProperty

TextAlignmentProperty

Declaration

cs-api-definition
public static RadProperty TextAlignmentProperty

Field Value

RadProperty

TextOrientationProperty

Declaration

cs-api-definition
public static RadProperty TextOrientationProperty

Field Value

RadProperty

TextProperty

Declaration

cs-api-definition
public static RadProperty TextProperty

Field Value

RadProperty

TextRenderingHintProperty

Declaration

cs-api-definition
public static RadProperty TextRenderingHintProperty

Field Value

RadProperty

TextWrapProperty

Declaration

cs-api-definition
public static RadProperty TextWrapProperty

Field Value

RadProperty

UseMnemonicProperty

Declaration

cs-api-definition
public static RadProperty UseMnemonicProperty

Field Value

RadProperty

Properties

AutoEllipsis

Gets or sets a value indicating whether the additional label text is to be indicated by an ellipsis.

Declaration

cs-api-definition
public bool AutoEllipsis { get; set; }

Property Value

bool

true if the additional label text is to be indicated by an ellipsis otherwise, false. Default value is true.

Implements ITextProvider.AutoEllipsis

CachedForeColor

Declaration

cs-api-definition
[Browsable(false)]
public Color CachedForeColor { get; set; }

Property Value

Color

DisableHTMLRendering

Declaration

cs-api-definition
public bool DisableHTMLRendering { get; set; }

Property Value

bool

DisabledTextRenderingHint

Gets or sets the text rendering hint used when this primitive is disabled.

Declaration

cs-api-definition
public virtual TextRenderingHint DisabledTextRenderingHint { get; set; }

Property Value

TextRenderingHint

A TextRenderingHint value that specifies the text rendering quality for disabled state. The default value is AntiAliasGridFit.

Remarks

This property allows for different text rendering quality when the primitive is disabled, often providing a softer appearance that visually indicates the disabled state.

FlipText

Gets or sets a value indicating whether the text should be flipped (mirrored) during rendering.

Declaration

cs-api-definition
public bool FlipText { get; set; }

Property Value

bool

true if the text should be flipped; otherwise, false. The default value is false.

Implements ITextProvider.FlipText

Remarks

Text flipping creates a mirror image of the text, which can be useful for special visual effects or when implementing right-to-left language support with custom rendering requirements. This property works in conjunction with TextOrientation for advanced text transformations.

IsEmpty

Gets a value indicating whether this primitive contains any displayable content.

Declaration

cs-api-definition
public override bool IsEmpty { get; }

Property Value

bool

true if the Text property is null or empty; otherwise, false.

Overrides BasePrimitive.IsEmpty

Remarks

This property is used by the layout system and rendering engine to optimize operations by skipping empty text primitives during layout calculations and paint operations.

LineLimit

Gets or sets a value indicating whether text rendering is limited to a specific number of lines.

Declaration

cs-api-definition
public bool LineLimit { get; set; }

Property Value

bool

true if line limiting is enabled; otherwise, false.

Remarks

When enabled, this property works in conjunction with other text formatting options to control the maximum number of lines displayed, providing better control over text layout in constrained spaces.

MeasureTrailingSpaces

Gets or sets a value indicating whether trailing spaces at the end of each line are included in text measurement calculations.

Declaration

cs-api-definition
public bool MeasureTrailingSpaces { get; set; }

Property Value

bool

true to include trailing spaces in text measurement; otherwise, false. The default value is true.

Implements ITextProvider.MeasureTrailingSpaces

Remarks

By default, the boundary rectangle returned by text measurement methods excludes trailing spaces at the end of each line. Setting this property to true includes that space in measurement, which can be important for precise layout calculations and text alignment scenarios.

This property is particularly useful when working with text that needs to maintain exact spacing or when implementing custom text layout algorithms.

Shadow

Gets or sets the shadow settings.

Declaration

cs-api-definition
[TypeConverter("Telerik.WinControls.UI.Design.ShadowSettingsConverter, Telerik.WinControls.UI.Design, Version=2026.1.217.48, Culture=neutral, PublicKeyToken=5bb2a467cbec794e")]
public ShadowSettings Shadow { get; set; }

Property Value

ShadowSettings

Implements ITextProvider.Shadow

ShowKeyboardCues

Gets or sets a value indicating whether if the keyboard accelerators are visible.

Declaration

cs-api-definition
public bool ShowKeyboardCues { get; set; }

Property Value

bool

true if if the keyboard accelerators are visible otherwise, false.

Implements ITextProvider.ShowKeyboardCues

StretchHorizontally

Gets or sets a value indicating whether this primitive stretches horizontally within its parent layout.

Declaration

cs-api-definition
public override bool StretchHorizontally { get; set; }

Property Value

bool

true if the primitive should stretch horizontally; otherwise, false. The default value is false.

Overrides RadElement.StretchHorizontally

Remarks

For text primitives, horizontal stretching is typically disabled to maintain text layout integrity and prevent unwanted text spacing or alignment issues.

StretchVertically

Gets or sets a value indicating whether this primitive stretches vertically within its parent layout.

Declaration

cs-api-definition
public override bool StretchVertically { get; set; }

Property Value

bool

true if the primitive should stretch vertically; otherwise, false. The default value is false.

Overrides RadElement.StretchVertically

Remarks

For text primitives, vertical stretching is typically disabled to maintain proper text positioning and prevent text from being improperly aligned within the available vertical space.

Text

Gets or sets the text content displayed by this primitive.

Declaration

cs-api-definition
public string Text { get; set; }

Property Value

string

A string containing the text to display. Returns an empty string if the value is null.

Implements ITextProvider.Text

Remarks

The text property supports various formatting features including mnemonics (ampersand characters), HTML rendering capabilities, and automatic layout adjustments based on the available space.

Setting this property automatically triggers layout invalidation and may enable HTML rendering if the text contains HTML markup and HTML rendering is not explicitly disabled.

TextAlignment

Gets or sets the text alignment within the primitive's bounds.

Declaration

cs-api-definition
public ContentAlignment TextAlignment { get; set; }

Property Value

ContentAlignment

A ContentAlignment value that specifies how text is aligned within the available space. The default value is MiddleLeft.

Implements ITextProvider.TextAlignment

Remarks

This property controls both horizontal and vertical text alignment. Common values include TopLeft, MiddleCenter, and BottomRight among others, providing flexible text positioning within the primitive's layout bounds.

TextOrientation

Gets or sets the text orientation for rendering.

Declaration

cs-api-definition
public Orientation TextOrientation { get; set; }

Property Value

Orientation

An Orientation value that specifies whether text is rendered horizontally or vertically. The default value is Horizontal.

Implements ITextProvider.TextOrientation

Remarks

When set to Vertical, the text is rotated 90 degrees counterclockwise. This property is useful for creating vertical labels, headers, or other UI elements that require rotated text display.

TextRenderingHint

Gets or sets the text rendering hint that controls the quality and appearance of text rendering.

Declaration

cs-api-definition
public virtual TextRenderingHint TextRenderingHint { get; set; }

Property Value

TextRenderingHint

A TextRenderingHint value that specifies the text rendering quality. The default value is SystemDefault.

Remarks

This property determines the quality of text rendering, affecting anti-aliasing, hinting, and overall text appearance. Use AntiAlias for smooth text rendering or ClearTypeGridFit for optimal LCD display quality.

TextWrap

Gets or sets a value indicating whether the text should wrapped to the available layout rectangle.

Declaration

cs-api-definition
public bool TextWrap { get; set; }

Property Value

bool

true if the text should wrapped to the available layout rectangle otherwise, false.

Implements ITextProvider.TextWrap

UseMnemonic

Gets or sets a value indicating whether the control interprets an ampersand character (&) in the control's Text property to be an access key prefix character.

Declaration

cs-api-definition
public bool UseMnemonic { get; set; }

Property Value

bool

true if the label doesn't display the ampersand character and underlines the character after the ampersand in its displayed text and treats the underlined character as an access key; otherwise, false if the ampersand character is displayed in the text of the control. The default is true.

Implements ITextProvider.UseMnemonic

Methods

AllowHTMLRendering()

Declaration

cs-api-definition
public bool AllowHTMLRendering()

Returns

bool

ArrangeCore(RectangleF)

Performs the core arrangement logic for the element within the specified final rectangle.

Declaration

cs-api-definition
protected override void ArrangeCore(RectangleF finalRect)

Parameters

finalRect

RectangleF

The final rectangular area allocated for this element.

Overrides RadElement.ArrangeCore(RectangleF)

ArrangeOverride(SizeF)

Arranges the RadElement to its final location. The element must call the Arrange method of each of its children.

Declaration

cs-api-definition
protected override SizeF ArrangeOverride(SizeF finalSize)

Parameters

finalSize

SizeF

The size that is available for element.

Returns

SizeF

The rectangle occupied by the element. Usually finalSize. Should you return different size, the Layout system will restart measuring and rearranging the items. That could lead to infinite recursion.

Overrides RadElement.ArrangeOverride(SizeF)

Remarks

In this method call to the Arrange method of each child must be made.

CreateStringFormat()

Declaration

cs-api-definition
public StringFormat CreateStringFormat()

Returns

StringFormat

CreateTextParams()

Declaration

cs-api-definition
protected virtual TextParams CreateTextParams()

Returns

TextParams

GetFaceRectangle()

Declaration

cs-api-definition
public RectangleF GetFaceRectangle()

Returns

RectangleF

Implements ITextProvider.GetFaceRectangle()

GetStylablePropertiesFilter()

Gets the IFilter instance that may be used to filter the properties, treated as Stylable for this element.

Declaration

cs-api-definition
public override Filter GetStylablePropertiesFilter()

Returns

Filter

Overrides RadElement.GetStylablePropertiesFilter()

GetTextSize()

Declaration

cs-api-definition
public SizeF GetTextSize()

Returns

SizeF

GetTextSize(SizeF)

Declaration

cs-api-definition
public SizeF GetTextSize(SizeF proposedSize)

Parameters

proposedSize

SizeF

Returns

SizeF

GetTextSize(SizeF, TextParams)

Declaration

cs-api-definition
public SizeF GetTextSize(SizeF proposedSize, TextParams textParams)

Parameters

proposedSize

SizeF

textParams

TextParams

Returns

SizeF

Implements ITextPrimitive.GetTextSize(SizeF, TextParams)

GetTextSize(TextParams)

Declaration

cs-api-definition
public SizeF GetTextSize(TextParams textParams)

Parameters

textParams

TextParams

Returns

SizeF

Implements ITextPrimitive.GetTextSize(TextParams)

InitializeFields()

Initializes member fields to their default values. This method is called prior the CreateChildItems one and allows for initialization of members on which child elements depend.

Declaration

cs-api-definition
protected override void InitializeFields()

Overrides BasePrimitive.InitializeFields()

MeasureOverride(SizeF)

Measures the space required by the RadElement

Used by the layout system.

Declaration

cs-api-definition
protected override SizeF MeasureOverride(SizeF availableSize)

Parameters

availableSize

SizeF

The size that is available to the RadElement. The available size can be infinity (to take the full size of the element)

Returns

SizeF

The minimum size required by the element to be completely visible. Cannot be infinity.

Overrides RadElement.MeasureOverride(SizeF)

Remarks

In this method call to the Measure method of each child must be made.

MeasureOverride(SizeF, TextParams)

Declaration

cs-api-definition
public SizeF MeasureOverride(SizeF availableSize, TextParams textParams)

Parameters

availableSize

SizeF

textParams

TextParams

Returns

SizeF

Implements ITextPrimitive.MeasureOverride(SizeF, TextParams)

OnMouseMove(MouseEventArgs)

Declaration

cs-api-definition
protected override void OnMouseMove(MouseEventArgs e)

Parameters

e

MouseEventArgs

Overrides RadElement.OnMouseMove(MouseEventArgs)

OnMouseMove(object, MouseEventArgs)

Declaration

cs-api-definition
public void OnMouseMove(object sender, MouseEventArgs e)

Parameters

sender

object

e

MouseEventArgs

Implements ITextPrimitive.OnMouseMove(object, MouseEventArgs)

OnPropertyChanged(RadPropertyChangedEventArgs)

Called when a property value has changed, allowing for custom response to property changes.

Declaration

cs-api-definition
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)

Parameters

e

RadPropertyChangedEventArgs

The property changed event arguments.

Overrides VisualElement.OnPropertyChanged(RadPropertyChangedEventArgs)

PaintPrimitive(IGraphics, TextParams)

Declaration

cs-api-definition
public void PaintPrimitive(IGraphics graphics, TextParams textParams)

Parameters

graphics

IGraphics

textParams

TextParams

Implements ITextPrimitive.PaintPrimitive(IGraphics, TextParams)

PaintPrimitive(IGraphics, float, SizeF)

Draws the primitive on the screen.

Declaration

cs-api-definition
public override void PaintPrimitive(IGraphics graphics, float angle, SizeF scale)

Parameters

graphics

IGraphics

angle

float

scale

SizeF

Overrides BasePrimitive.PaintPrimitive(IGraphics, float, SizeF)

PaintPrimitive(IGraphics, float, SizeF, TextParams)

Declaration

cs-api-definition
public void PaintPrimitive(IGraphics graphics, float angle, SizeF scale, TextParams textParams)

Parameters

graphics

IGraphics

angle

float

scale

SizeF

textParams

TextParams

Implements ITextPrimitive.PaintPrimitive(IGraphics, float, SizeF, TextParams)

ToString()

Returns the text as a string.

Declaration

cs-api-definition
public override string ToString()

Returns

string

Overrides RadElement.ToString()

ToggleHTML(string)

Declaration

cs-api-definition
public void ToggleHTML(string text)

Parameters

text

string