This documentation is archived and is not being maintained.

TextPointer.DeleteTextInRun Method

Deletes the specified number of characters from the position indicated by the current TextPointer.

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

public int DeleteTextInRun(
	int count
)

Parameters

count
Type: System.Int32
The number of characters to delete, starting at the current position. Specify a positive value to delete characters that follow the current position; specify a negative value to delete characters that precede the current position.

Return Value

Type: System.Int32
The number of characters actually deleted.

ExceptionCondition
InvalidOperationException

The method is called at a position where text is not allowed.

Specify a positive value to delete characters that follow the current position (as in LogicalDirection.Forward); specify a negative value to delete characters that precede the current position (as in LogicalDirection.Backward).

The number of characters actually deleted may be less than the number specified by count. This happens in cases where count specifies more characters than exist to be deleted.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: