System.Windows.Forms.MaskedTextBox.PasswordChar Property

Gets or sets the character to be displayed in substitute for user input.

Syntax

[System.ComponentModel.DefaultValue('\0')]
[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
public char PasswordChar { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

For sensitive user input, it is common practice to conceal the actual information entered by the user. If the MaskedTextBox.PasswordChar property is set to a non-null character, System.Windows.Forms.MaskedTextBox will display this character for all input into the control. Setting this property to null will disable this functionality.

If you want to use the operating system supplied password character, which is defined in COMCTL32.dll, use the MaskedTextBox.UseSystemPasswordChar property instead. If both the MaskedTextBox.PasswordChar and MaskedTextBox.UseSystemPasswordChar properties are activated, the latter takes precedence.

Note:

As a security consideration, the System.Windows.Forms.MaskedTextBox control disables cut and copy operations on password-protected strings.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0