System.Windows.Forms.TextBox.PasswordChar Property

Gets or sets the character used to mask characters of a password in a single-line System.Windows.Forms.TextBox control.

Syntax

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

Value

Documentation for this section has not yet been entered.

Remarks

The TextBox.UseSystemPasswordChar property has precedence over the TextBox.PasswordChar property. Whenever the TextBox.UseSystemPasswordChar is set to true, the default system password character is used and any character set by TextBox.PasswordChar is ignored.

When the TextBox.PasswordChar property is set, cut and copy actions in the control using the keyboard cannot be performed.

Note:

When the System.Windows.Forms.TextBox is in password mode because TextBox.PasswordChar, TextBox.UseSystemPasswordChar, or TextBoxBase.ReadOnly is true, the System.Windows.Forms.TextBox is in restricted mode. In this mode, the System.Windows.Forms.ImeMode is disabled, but the current System.Windows.Forms.ImeMode is cached so that it can be restored if the System.Windows.Forms.TextBox ever becomes unrestricted. Toggling the TextBoxBase.ReadOnly is a common scenario. The System.Windows.Forms.ImeMode is shadowed while the control is in restricted mode. From the designer perspective, the System.Windows.Forms.ImeMode value shown is the actual value.

Requirements

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