PasswordBox

The PasswordBox control is a special text box intended for entering passwords and that automatically hides characters. The following code snippet shows an example:

image

By default characters are hidden with a dot, but you can replace it via the PasswordChar property (optional). The MaxLength property limits the password length (optional). Such control exposes the Password property of type String that is the entered password, as demonstrated by the following code:

image

Figure 32.13 shows the result of the code.

Figure 32.13 Implementing a PasswordBox ...

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.