PasswordChar Property

       

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.

Syntax

object.PasswordChar [= value]

The PasswordChar property syntax has these parts:

Part Description
Object An object expression that evaluates to an object in the Applies To list.
Value A string expression specifying 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 use the asterisk (*) (Chr(42)).

This property doesn't 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.