TextBox.GetRectFromCharacterIndex 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回指定索引处字符边缘的矩形。
重载
| 名称 | 说明 |
|---|---|
| GetRectFromCharacterIndex(Int32) |
返回指定索引处字符的前边缘的矩形。 |
| GetRectFromCharacterIndex(Int32, Boolean) |
返回指定索引处字符的前导边缘或尾部的矩形。 |
GetRectFromCharacterIndex(Int32)
返回指定索引处字符的前边缘的矩形。
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
参数
- charIndex
- Int32
要为其检索矩形的字符的从零开始的字符索引。
返回
指定字符索引处字符前边缘的矩形,或者 Empty 无法确定边界矩形。
注解
由于此方法返回一个表示字符边缘的矩形,矩形的宽度为 0。
适用于
GetRectFromCharacterIndex(Int32, Boolean)
返回指定索引处字符的前导边缘或尾部的矩形。
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
参数
- charIndex
- Int32
要为其检索矩形的字符的从零开始的字符索引。
- trailingEdge
- Boolean
true 获取字符的尾部; false 获取字符的前边缘。
返回
指定字符索引处字符边缘的矩形,或者 Empty 无法确定边界矩形。
例外
charIndex 为负数或大于内容的长度。
注解
由于此方法返回一个表示字符边缘的矩形,矩形的宽度为 0。