Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

password problim

Status
Not open for further replies.

mickeymouse70310

Programmer
Feb 8, 2004
1
GB
can any one please tell me how to make the text box pass word, not display yhe cheractors when the user enter its password


if (Usrname.Text == "sirasafamily" && Passwd.Text == "lovegamini" )
{
MessageBox.Show ("Welcome Shanika");
Pro display = new Pro ();
display.Show ();
}

else
{
MessageBox.Show ("The User name or password is incorrect", "Bad Input",MessageBoxButtons.YesNoCancel);
}
Usrname.Text = "" ;
Passwd.Text = "" ;

 
You have to set the PasswordChar property of the textbox to the character you want to display instead of the character entered by the user.

Code:
Passwd.PasswordChar = '*';

You can do this in the IDE, on control creation, in the form load event, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top