• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 465
  • Last Modified:

Mask / Unmask PwChar in Textbox

How do i make it when i hold down the mouse in the textbox field with the passchar it will show the password and when i let go out mouse button it goes back to pass char.
0
thaburner
Asked:
thaburner
1 Solution
 
bingieCommented:
(Assuming visual basic)

Add a textbox and paste the following:

Private Sub Form_Load()
 Text1.PasswordChar = "#"
End Sub

Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
 Text1.PasswordChar = ""
End Sub

Private Sub Text1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
 Text1.PasswordChar = "#"
End Sub
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now