Returns or sets a value indicating whether the characters typed by a user or placeholder characters are displayed in a TextBox control; returns or sets the character used as a placeholder.
object.PasswordChar [= value]
The parts of the PasswordChar property syntax are described in the following table.
Part | Description |
---|---|
object | An object expression that evaluates to an object. |
value | A string expression specifying the placeholder character. |
Use this property to create a password field in a dialog box. Although you can use any character, most Windows-based applications use the asterisk (*) (Chr(42)).
This property does not affect the Text property; Text contains exactly what the 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.
Note If the MultiLine Property is set to True, setting the PasswordChar property will have no effect.