PasswordChar Property

Applies To   See Also

Determines whether the characters entered by a user or placeholder characters are displayed in a TextBox control; determines the character used as a placeholder. Available at design time and run time.

Syntax

TextBox.PasswordChar[ = cCharString]

Settings

cCharString

Specifies the characters displayed in a text box.

Remarks

Use this property to create a password field in a dialog box. Although you can use any character, most applications use the asterisk (*), ANSI character 42.

This property does not affect the Value property setting; it contains exactly what the user types or what was set from code. Set PasswordChar to an empty string ("") to display the actual text. The default setting is an empty string.

You can assign any string to this property, but only the first character is significant; all others are ignored.