TextBox.GetRectFromCharacterIndex Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the rectangle for an edge of the character at the specified index.
Overloads
GetRectFromCharacterIndex(Int32) |
Returns the rectangle for the leading edge of the character at the specified index. |
GetRectFromCharacterIndex(Int32, Boolean) |
Returns the rectangle for the leading or trailing edge of the character at the specified index. |
GetRectFromCharacterIndex(Int32)
Returns the rectangle for the leading edge of the character at the specified index.
public:
System::Windows::Rect GetRectFromCharacterIndex(int charIndex);
public System.Windows.Rect GetRectFromCharacterIndex (int charIndex);
member this.GetRectFromCharacterIndex : int -> System.Windows.Rect
Public Function GetRectFromCharacterIndex (charIndex As Integer) As Rect
Parameters
- charIndex
- Int32
The zero-based character index of the character for which to retrieve the rectangle.
Returns
A rectangle for the leading edge of the character at the specified character index, or Empty if a bounding rectangle cannot be determined.
Remarks
Because this method returns a rectangle that represents an edge of the character, the width of the rectangle is 0.
Applies to
GetRectFromCharacterIndex(Int32, Boolean)
Returns the rectangle for the leading or trailing edge of the character at the specified index.
public:
System::Windows::Rect GetRectFromCharacterIndex(int charIndex, bool trailingEdge);
public System.Windows.Rect GetRectFromCharacterIndex (int charIndex, bool trailingEdge);
member this.GetRectFromCharacterIndex : int * bool -> System.Windows.Rect
Public Function GetRectFromCharacterIndex (charIndex As Integer, trailingEdge As Boolean) As Rect
Parameters
- charIndex
- Int32
The zero-based character index of the character for which to retrieve the rectangle.
- trailingEdge
- Boolean
true
to get the trailing edge of the character; false
to get the leading edge of the character.
Returns
A rectangle for an edge of the character at the specified character index, or Empty if a bounding rectangle cannot be determined.
Exceptions
charIndex
is negative or is greater than the length of the content.
Remarks
Because this method returns a rectangle that represents an edge of the character, the width of the rectangle is 0.
Applies to
.NET