replace password characters

alaric

Well-known member
Joined
Oct 12, 2005
Messages
53
Programming Experience
Beginner
[RESOLVED] replace password characters

Hi,

I have searched the forum but cant find anything about replacing characters while the user is typing.

I want the login form not show the password a user is typing. Meaning, while typing replacing the text by *.

Hope someone can helpe me.
i tried
VB.NET:
[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] txtPassword_KeyPress([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Object[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Windows.Forms.KeyPressEventArgs) [/SIZE][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][SIZE=2] txtPassword.KeyPress
txtPassword.Text = txtPassword.Text.Replace("", "*")
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub
[/COLOR][/SIZE]

but this doesn't work

thanks in advance
 
Last edited:
Hey alaric,

Check out the properties for textbox, change the password chracter to whatever you want to use, does it all for you. I personally like to use • you can get this by holding alt and typing 0149.
 
Back
Top