Export (0) Print
Expand All

TextPointer.GetPositionAtOffset Method (Int32, LogicalDirection)

Returns a TextPointer to the position indicated by a specified offset, in symbols, from the beginning of this TextPointer.

Namespace: System.Windows.Documents
Assembly: PresentationFramework (in presentationframework.dll)

public TextPointer GetPositionAtOffset (
	int offset,
	LogicalDirection direction
public TextPointer GetPositionAtOffset (
	int offset, 
	LogicalDirection direction
public function GetPositionAtOffset (
	offset : int, 
	direction : LogicalDirection
) : TextPointer
You cannot use methods in XAML.



An offset, in symbols, for which to calculate and return the corresponding position for. If the offset is negative, the returned TextPointer precedes this TextPointer, otherwise it follows.


The logical direction of the returned TextPointer.

Return Value

A TextPointer to the position indicated by the specified offset, or null if the offset extends past the end of the content.

Any of the following is considered to be a symbol:

  • An opening or closing tag for TextElement element.

  • A UIElement element contained within an InlineUIContainer or BlockUIContainer. Note that such a UIElement is always counted as exactly one symbol; any additional content or elements contained by the UIElement are not counted as symbols.

  • Each 16-bit Unicode character inside of a text Run element.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

© 2014 Microsoft