MaskedTextProvider.RemoveAt Method (Int32, Int32, Int32, MaskedTextResultHint)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Removes the assigned characters between the specified positions from the formatted string, and then outputs the removal position and descriptive information.

Namespace:   System.ComponentModel
Assembly:  System (in System.dll)

public bool RemoveAt(
	int startPosition,
	int endPosition,
	out int testPosition,
	out MaskedTextResultHint resultHint
)

Parameters

startPosition
Type: System.Int32

The zero-based index of the first assigned character to remove.

endPosition
Type: System.Int32

The zero-based index of the last assigned character to remove.

testPosition
Type: System.Int32

If successful, the zero-based position in the formatted string of where the characters were actually removed; otherwise, the first position where the operation failed. An output parameter.

resultHint
Type: System.ComponentModel.MaskedTextResultHint

A MaskedTextResultHint that succinctly describes the result of the operation. An output parameter.

Return Value

Type: System.Boolean

true if the character was successfully removed; otherwise, false.

The RemoveAt method has no effect if there are no assigned characters at the removal positions specified.

When a character is removed, the remaining higher-positioned characters in the mask will shift to the left to fill in the gap created by the removal. Vacated positions are reset for input. If movement of the characters is prevented by the mask definition, no removal occurs, and RemoveAt returns false.

This version of RemoveAt provides two additional output parameters to convey more information about the operation of the method.

.NET Framework
Available since 2.0
Return to top
Show: