0

I am creating password enable/disable show option in my Windows Forms. I drew this up, and it is not working. Any reason why? There are not errors shown. The password fields are simply not changing when the button is clicked.

   if (textBox3.PasswordChar == '*')
    {
        textBox3.PasswordChar = '\0';
    }
    else if (textBox3.PasswordChar == '\0')
    {
        textBox3.PasswordChar = '*';
    }
OracleStart
  • 53
  • 2
  • 9

1 Answers1

2

Should be as simple as this. The simple part is remove the other if statement.

        if (textBox3.PasswordChar == '*')
        {

            textBox3.PasswordChar = '\0';
        }
        else
        {
            textBox3.PasswordChar = '*';
        }
Sorceri
  • 7,870
  • 1
  • 29
  • 38