New to Telerik UI for WinForms? Start a free 30-day trial

Stores the text, formatting, image, and list metadata for one segment in a formatted text block.

Definition

Namespace:Telerik.WinControls.TextPrimitiveUtils

Assembly:Telerik.WinControls.dll

Syntax:

C#
public class FormattedText

Inheritance: objectFormattedText

Constructors

Default constructor

C#
public FormattedText()

Copy constructor

C#
public FormattedText(FormattedText prototypeFormattedText)
Parameters:prototypeFormattedTextFormattedText

Fields

C#
protected FormattedText.HTMLLikeListType prevListType

Properties

Gets or sets the baseline.

C#
public float BaseLine { get; set; }

Gets or sets the background color.

C#
public Color? BgColor { get; set; }

Get or sets the Size of current text block

C#
public SizeF BlockSize { get; }

Gets or sets the font name of the bullets.

C#
public string BulletFontName { get; set; }

Gets or sets the font size of the bullets.

C#
public float BulletFontSize { get; set; }

Gets or sets the font style of the bullets.

C#
public FontStyle BulletFontStyle { get; set; }

Gets the size of bullets.

C#
public SizeF BulletSize { get; }

Gets or sets the content alignment.

C#
public ContentAlignment ContentAlignment { get; set; }

Gets the drawing rectangle.

C#
public RectangleF DrawingRectangle { get; }

Gets or sets the font color.

C#
public Color FontColor { get; set; }

Gets or sets the font name.

C#
public string FontName { get; set; }

Get or sets size of the font. Note: recreate the font

C#
public float FontSize { get; set; }

Gets or sets the font style.

C#
public FontStyle FontStyle { get; set; }

Get or sets HTML tag of the current text block.

C#
public string HtmlTag { get; set; }

Get or sets Image for the current text block Current block should be named Image block

C#
public Image Image { get; set; }

Gets or sets a value indicating whether is closing tag.

C#
public bool IsClosingTag { get; set; }

Gets or sets the link that is opened when the item is clicked.

C#
public string Link { get; set; }

Gets or sets the list type.

C#
public FormattedText.HTMLLikeListType ListType { get; set; }

Gets or sets the number used in ordered list with numbering.

C#
public int Number { get; set; }

Gets or sets the offset of the text.

C#
public int Offset { get; set; }

Gest the offset size of the text.

C#
public float OffsetSize { get; }

Gets or sets a value indicating whether to display a bullet.

C#
public bool ShouldDisplayBullet { get; set; }

Gets or sets a value indicating whether to start a new line.

C#
public bool StartNewLine { get; set; }

Get or set the text.

C#
public string Text { get; set; }

Methods

Gets the size of the text block.

C#
public SizeF GetTextBlockSize(bool useCompatibleTextRendering, TextFormatFlags textFormatFlags)
Parameters:useCompatibleTextRenderingbooltextFormatFlagsTextFormatFlagsReturns:

SizeF

Draws the segment's image, if present, and then its text using the selected text-rendering path.

C#
public void PaintFormatText(IGraphics graphics, RectangleF paintingRectangle, bool useCompatibleTextRendering, TextFormatFlags flags, PointF currentLineBeginLocation, float lineHeight, float lineBaseLine, bool clipText)
Parameters:graphicsIGraphics

The graphics context used for drawing.

paintingRectangleRectangleF

The bounds available for the text segment.

useCompatibleTextRenderingbool

true to draw with GDI+; otherwise, use TextRenderer.

flagsTextFormatFlags

The text-rendering flags used by TextRenderer.

currentLineBeginLocationPointF

The start point of this segment within its line.

lineHeightfloat

The measured height of the containing line.

lineBaseLinefloat

The baseline of the containing line, used to align this segment.

clipTextbool

true to clip GDI+ text to its drawing rectangle.

The literal   token is replaced with a regular space before drawing.