'How to make PasswordBox plaintext [duplicate]
I'm trying to make it so that when I check my CheckBox, The current password typed into the passwordbox will be displayed in plaintext rather than the current asterisk.
Current code:
private void chkBoxShowPassword_Checked(object sender, RoutedEventArgs e)
{
if (chkBoxShowPassword.IsChecked == true)
{
txtPassword.Password.ToString();
// txtPassword.PasswordChar = 'h';
}
else
{
}
}
I tried the "ToString" method but that didnt do anything when i checked the box & I also tried setting the passwordChar to "h" but obviously that doesnt store the password in plaintext but just sets every character to be the letter "h".
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
