PasswordChar

This property returns and sets a value that indicates whether placeholder characters or the characters typed by a user are displayed in a TextBox control.

Syntax

object.PasswordChar [= value]

Parameters

object
Object expression that evaluates to a TextBox control.
value
String expression that specifies the placeholder character.

Remarks

Use this property to create a password field in a dialog box. Although you can use any character, most Windows-based applications, including Windows CE-based applications, use the asterisk (*) (Chr(42)).

This property does not affect the Text property; Text contains exactly what a user types or what was set from code. Set PasswordChar to a zero-length string (""), which is the default, to display the actual text.

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

If the MultiLine property is set to True, setting the PasswordChar property has no effect.