TextRange.Select(TextPointer, TextPointer) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
更新当前所选内容,采用两个 TextPointer 位置来指示更新的选择。
public:
void Select(System::Windows::Documents::TextPointer ^ position1, System::Windows::Documents::TextPointer ^ position2);
public void Select(System.Windows.Documents.TextPointer position1, System.Windows.Documents.TextPointer position2);
member this.Select : System.Windows.Documents.TextPointer * System.Windows.Documents.TextPointer -> unit
Public Sub Select (position1 As TextPointer, position2 As TextPointer)
参数
- position1
- TextPointer
一个固定定位点位置,用于标记更新所选内容的一端。
- position2
- TextPointer
一个可移动位置,用于标记更新所选内容的另一端。
例外
在同一文档中未定位时position1发生。position2
在或为position1position2时null发生 。
注解
A TextRange 由 TextPointers 指示的两个位置之间的选择构成。 其中一个位置(由 position1)相对于所选内容是固定的,而另一个位置(由 position2)是可移动的。 这类似于用户使用鼠标或键盘所做的选择的方式。
可以调整新所选内容的实际结尾,以匹配适用于包含新当前所选内容的文档的任何选择启发式。