Reputation: 39
I have used a code like this
EPF_NO.PasswordChar = '*';
Now EPF_NO text box is showing ***
like that and I'm okay with that.
but I need to get it to normal mode when I clicked on a radio button.
Upvotes: 0
Views: 364
Reputation: 3326
use the following code:
EPF_NO.PasswordChar = '\0';
EPF_NO.UseSystemPasswordChar = false;
Upvotes: 0
Reputation: 29026
Add the following code in Radio button
click event
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
if (radioButton1.Checked) { textBox1.PasswordChar='\0'; }
else { textBox1.PasswordChar = '*'; }
}
Upvotes: 0
Reputation: 186748
Eh, something like that?
EPF_NO.PasswordChar = showPlainTextRadioButton.Checked ? '\0' : '*';
Upvotes: 1
Reputation: 4645
You can do this by setting the property to default '0'
if (toggleSwitch1.IsOn)
{
string a = EPF_NO.Text;
EPF_NO.PasswordChar = '\0';
}
else
{
EPF_NO.PasswordChar = '*';
}
Upvotes: 1