PromptChar Property

Returns or sets the prompt character. The default prompt character is the underscore (_).
Public Property PromptChar As Char
public char PromptChar {get; set;}

Prompt character is the character that's displayed in place of any blank display characters. Each display character is a place holder in the mask where the user enters the characters as required by the mask. The default prompt character is underscore (_).

The following code demonstrates how PromptChar property works. By default the masked editor displays underscore ('_') to indicate that the mask chracter is empty. You can change that using the PromptChar property. The following code set sthe PromptChar to question mark ('?'). This will display '?' characters in place of empty mask characters. Note: You may have to give focus to the editor to see the prompt characters. This is because when the control is empty, it displays null text and not the prompt characters until you enter it into edit mode.


Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, 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

See Also