Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reveal password textbox control on windows

Are there any APIs in Windows to turn a password textbox into something like this:

enter image description here

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?

like image 655
huseyint Avatar asked Sep 29 '22 15:09

huseyint


1 Answers

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

like image 196
LarsTech Avatar answered Oct 04 '22 03:10

LarsTech