kaushmi love
kaushmi love

Reputation: 39

how to reverse the textbox input method in c#

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

Answers (5)

amit dayama
amit dayama

Reputation: 3326

use the following code:

EPF_NO.PasswordChar = '\0';
EPF_NO.UseSystemPasswordChar = false;

Upvotes: 0

sujith karivelil
sujith karivelil

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

Dmitrii Bychenko
Dmitrii Bychenko

Reputation: 186748

Eh, something like that?

EPF_NO.PasswordChar = showPlainTextRadioButton.Checked ? '\0' : '*';

Upvotes: 1

xeraphim
xeraphim

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

Nikita Shrivastava
Nikita Shrivastava

Reputation: 3018

set EPF_NO.PasswordChar = '\0';

Upvotes: 2

Related Questions