How can I unmask password text box and mask it back to password?

前端 未结 7 1067
情深已故
情深已故 2020-11-27 21:36

How can password textbox that set to :

password_txtBox.PasswordChar =\"*\"

to be unmasked ( from checkbox ) and then mask again
without

7条回答
  •  醉酒成梦
    2020-11-27 22:16

    txtPassword is the Password textbox, chkSeePassword is the Show password checkbox. Now add some code to the checkbox's CheckedChanged event

    private void chkSeePassword_CheckedChanged(object sender, EventArgs e)
    {
            txtPassword.UseSystemPasswordChar = !chkSeePassword.Checked;
    }
    

提交回复
热议问题