Reputation: 15081
Are there any APIs in Windows to turn a password textbox into something like this:
So that users will be able to reveal the password for a second while pressing the eye icon right next to textbox. Do you know any P/Invoke like API exists that I can call from my WinForms app?
Upvotes: 5
Views: 3769
Reputation: 81620
No need for an API for that, you just toggle it yourself:
textBox1.PasswordChar = textBox1.PasswordChar == '\0' ? '*' : '\0';
For placing a button inside a textbox, see Button inside a winforms textbox
Upvotes: 4