MaskedTextProvider.ResetOnPrompt Property

Definition

Gets or sets a value that determines how an input character that matches the prompt character should be handled.

public bool ResetOnPrompt { get; set; }

Property Value

true if the prompt character entered as input causes the current editable position in the mask to be reset; otherwise, false to indicate that the prompt character is to be processed as a normal input character. The default is true.

Remarks

MaskedTextProvider can treat two categories of characters, paces and prompt characters, in a special manner. Normally, each input character will be tested against the mask and either accepted or rejected. Operating on the assumption that the PromptChar property is set to a value other than null, then setting the ResetOnPrompt property to true will result in special processing for the prompt character. When a prompt character is added, it causes the current mask character position to be cleared and the current position to be advanced to the next editable character.

ResetOnPrompt takes precedence over the AllowPromptAsInput property as described in the following table.

ResetOnPrompt AllowPromptAsInput Resulting behavior
true true The prompt character can be added and it causes the current mask position to be reset. The default.
true false The prompt character can be added and it causes the current mask position to be reset.
false true The prompt character is processed as a normal input character.
false false The prompt character is not valid and methods attempting to add the character will fail.

Applies to

Produk Versi
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also