TextBox.GetRectFromCharacterIndex method

This topic has not yet been rated - Rate this topic

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

Syntax


public Rect GetRectFromCharacterIndex(
  int charIndex, 
  bool trailingEdge
)

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

Namespace

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

Metadata

Windows.winmd

See also

TextBox

 

 

Build date: 3/12/2013

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.