TextBox.GetRectFromCharacterIndex method

Applies to Windows and Windows Phone

Returns a rectangular region for the leading or trailing edge of a character at a specific character index.

Syntax

Public Function GetRectFromCharacterIndex(
  charIndex As Integer,  
  trailingEdge As Boolean 
) As Rect

Parameters

charIndex

Type: System.Int32 [.NET] | int32 [C++]

A zero-based index of the character for which to retrieve the rectangle.

trailingEdge

Type: System.Boolean [.NET] | Platform::Boolean [C++]

true to get the trailing edge; false to get the leading edge of the character.

Return value

Type: Rect

A rectangle for the edge of the character at the specified index.

Remarks

Because this method returns a rectangle that represents a character edge, the width of the rectangle that's returned is always 0. To get the width of a character, you must subtract the X value of the leading Rect from the X value of the trailing Rect.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

TextBox

 

 

Show:
© 2014 Microsoft. All rights reserved.