>
Blog
Book
Portfolio
Search

7/14/2008

10460 Views // 0 Comments // Not Rated

WPF PasswordBox Using "•" (Bullet) As The PasswordChar

Real quick:

I'm writing my first WPF form and one of the fields is a password. The ASP.NET TextBox control has a TextMode enum that you can set to "Password." After you set this property, your TextBox will display dots or starts (inherited from OS settings) instead of the characters typed.

Nothing shocking, I know.

But in WPF, password field functionality has been broken out into a separate control, the PasswordBox.There is a PasswordChar property that takes in a char that will be displayed. If left blank, the user's characters are displayed. (I've noticed some other cool functionality that pushes this beyond a glorified TextBox. For example, if you try to copy text to the clipboard from it, the text "Password" is pasted. That's pretty cool.)

Now that we all have iPhones and run Vista and log into millions of forms on the web each day, we are used to seeing pretty little dots show up when we type in a password. Look down at your keyboard. See the pretty little dot button? Me neither! In fact, the only keyboard I've seen that has this button is my iPhone (which doesn't run Visual Studio, so it won't help me here).

Anyways, to type a dot (or bullet), position the cursor, hold down the RIGHT ALT key, type "0149" using the keypad (without the quotes) and release the RIGHT ALT key. THAT is the pretty little dot button!

Now I feel like I've used VI!

No Tags

No Files

No Thoughts

Your Thoughts?

You need to login with Twitter to share a Thought on this post.


Loading...