Click here to Skip to main content
15,885,044 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
There is Textbox (txtPassword) and Checkbox (chkShowPass).

txtPassword has password characters like this (******).

I wanna see the original characters when i check the CheckBox(chkShowPass).

So, How can i write code for that?
Posted

Refer this similar thread
how to make a checkbox for changing the property of textbox from system password to simple plain text[^]

You can use this[^] link to convert the code from C# to VB.net
 
Share this answer
 
v2
VB
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
    If CheckBox1.Checked = False Then
        TextBox1.PasswordChar = ""
    Else
        TextBox1.PasswordChar = "*"
    End If
End Sub
 
Share this answer
 
Private Sub Check1_Click()
If Check1.Value = vbChecked Then
Text1.PasswordChar = ""
Else
Text1.PasswordChar = "B"
End If
End Sub

from=Bapi Roy
id=bapiroyavjict@gmail.com
 
Share this answer
 
Comments
Ralf Meier 21-Oct-20 5:25am    
What is the difference between your solution and the solution before ?
And ...
You should not provide your EMail-adresse in any Forum ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900