Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft