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

Represents text measurer of RadTextBoxControlElement.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class TextBoxControlMeasurer

Inheritance: objectTextBoxControlMeasurer

Constructors

C#
public TextBoxControlMeasurer()

Fields

Shared TextRenderer options for single-line, top-left text without padding or mnemonic-prefix processing.

C#
public const TextFormatFlags FormatFlags = SingleLine | NoClipping | NoPrefix | PreserveGraphicsClipping | PreserveGraphicsTranslateTransform | NoPadding

The rendering hint assigned to the graphics context used for text measurement.

C#
public const TextRenderingHint StringRenderingHint = SystemDefault

The number of average character widths used when measuring a tab.

C#
public const int TabSize = 4

Methods

Searches the text's index where the caret should be positioned

C#
public static int BinarySearchCaretIndex(string text, Font font, double availableWidth)
Parameters:textstring

The text.

fontFont

The font.

availableWidthdouble

The available width.

Returns:

int

Search the index position where the text should be wrapped for the available width.

C#
public static int BinarySearchWrapIndex(string text, Font font, float availableWidth)
Parameters:textstring

The text.

fontFont

The font.

availableWidthfloat

The available width.

Returns:

int

Measures a text.

C#
public static Size MeasureText(string text, Font font)
Parameters:textstring

The text.

fontFont

The font.

Returns:

Size