TextPointer 类

定义

表示文本元素中的位置。

public ref class TextPointer sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class TextPointer final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class TextPointer final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class TextPointer
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class TextPointer
Public NotInheritable Class TextPointer
继承
Object Platform::Object IInspectable TextPointer
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

属性

LogicalDirection

获取与当前位置关联的逻辑方向,该方向用于消除与当前位置关联的内容的歧义。

Offset

获取其容器中 TextPointer 的字符索引。

Parent

获取包含当前位置的逻辑父级。

VisualParent

获取用户界面 (UI) 元素,该元素“拥有”此 TextPointer

方法

GetCharacterRect(LogicalDirection)

返回以指定逻辑方向为当前 TextPointer 边框的内容的边界框。

GetPositionAtOffset(Int32, LogicalDirection)

返回一个 TextPointer ,该位置由指定偏移量(以符号为单位),从当前 TextPointer 的开头和指定方向返回。

适用于