Wednesday, May 28, 2014

Create an invisible password in Windows Application using C#

To day in this tutorial I will show you how to make an textbox in password mode without changing its TextMode property to Password.

I make this more simple by explaining the output of this program,

As an output there will be a textbox for inputing your password. But it will not show any charecter that will be written in the textbox, ie. invisible.

Create a new project and add a new form with a textbox, label & a button. Now on the TextChange event of the textbox write the code.

 label1.Text = label1.Text + textBox1.Text;
 textBox1.Text = "";

Make sure your label's  visible property if false.

Now in the button click event write down the code.

 label1.Text = "Your password : " + label1.Text;
 label1.Visible = true;

Now test your application.
Download the full source code here.

1 comment:

Popular Posts