How to show text as hidden using C #

I am developing in C #. I need to write down the password written inside a textbox, but would not like to show the entered password, specifying **** or any other character instead to hide the password.

How can i do this? I'm pretty sure that by changing the attribute, but can't find which one: - (

Thank!

+1


source to share


4 answers


http://msdn.microsoft.com/en-us/library/d3223ht2.aspx



set the PasswordChar property of the textbox

+4


source


Set the PasswordChar

property
.



+1


source


The TextBox class called "UseSystemPasswordChar" (assuming winforms) has a property that allows you to do this.

0


source


To use your own character: http://msdn.microsoft.com/en-us/library/system.windows.forms.textbox.passwordchar.aspx

To use the system default symbol: http://msdn.microsoft.com/en-us/library/system.windows.forms.textbox.usesystempasswordchar.aspx


textBox1.UseSystemPasswordChar = true;

//or

textBox1.PasswordChar = '%';

      

0


source







All Articles