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

前端 未结 7 1058
情深已故
情深已故 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:01

    For winforms:

    private void checkBoxShowPassword_CheckedChanged(object sender, EventArgs e) {
       textBoxPassword.PasswordChar = checkBoxShowPassword.Checked ? '\0' : '*';
    }
    

提交回复
热议问题