How can password textbox that set to :
password_txtBox.PasswordChar =\"*\"
to be unmasked ( from checkbox ) and then mask again
without
One of the easiest method to show and hide password is by using radio button inside password text box
The properties of radio button should be like:
this.radioBtn_ShowHidePassword.AutoCheck = false;
then the clicking activity has to be taken care manually just making it to be reverse of present state in its "Click" event
private void radioBtn_ShowHidePassword_Click(object sender, EventArgs e)
{
radioBtn_ShowHidePassword.Checked = (! radioBtn_ShowHidePassword.Checked);
}
then finally the easiest way of show and hide password
private void radioBtn_ShowHidePassword_CheckedChanged(object sender, EventArgs e)
{
txtBoxPassword.PasswordChar = radioBtn_ShowHidePassword.Checked ? '\0' : '*';
// here we can even include the code for changing the default picture of button to two different
//representation like closed eye and opened eye which resembles Windows login
}