See Also Example
Determines whether the characters typed by a user or placeholder characters are displayed in a text box; determines the character used as a placeholder.
[form.]textbox.PasswordChar[ = stringexpression ]
Use this property to create a password field in a dialog box. Although you can use any character, most applications for Windows use the asterisk (*) (Chr$ (42)).
This property does not affect the Text Set PasswordChar to an empty string ("") or to Chr$(0) to display the actual text. The default is an empty string. property; it contains exactly what the user types or what was set from code.
You can assign any string to this property, but only the first character is significant; all others are ignored.
Chapter 3, "Creating and Using Controls"
PasswordChar Property Example
The example illustrates how the PasswordChar property affects the way a text box displays text. To try this example, paste the code into the Declarations section of a form that contains a text box. Then press F5 and click the form. Each time you click the form, the text toggles between an asterisk password character and plain text.
Sub Form_Click ()
If Text1.PasswordChar = "" Then
Text1.PasswordChar = "*"
Text1.PasswordChar = ""