This documentation is archived and is not being maintained.

MaskedTextBox.ResetOnPrompt Property

Note: This property is new in the .NET Framework version 2.0.

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

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in

public bool ResetOnPrompt { get; set; }
/** @property */
public boolean get_ResetOnPrompt ()

/** @property */
public void set_ResetOnPrompt (boolean value)

public function get ResetOnPrompt () : boolean

public function set ResetOnPrompt (value : boolean)

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.

The MaskedTextBox can treat two categories of characters—spaces and prompt characters—specially. Typically, each input character will be tested against the mask and either accepted or rejected. Assuming that the PromptChar property is set to non-a null reference (Nothing in Visual Basic), then setting the ResetOnPrompt property to true will result in special processing for the prompt character. When the user enters the prompt character into the mask, 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 shown in the following table.

ResetOnPrompt value

AllowPromptAsInput value

Resulting behavior



The prompt character can be entered and it causes the current mask position to be reset. This is the default.



The prompt character can be entered and it causes the current mask position to be reset.



The prompt character is processed as a standard input character.



The prompt character is not valid and raises a MaskInputRejected event.

Windows 98, Windows 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 .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0