Mask / Unmask PwChar in Textbox

Posted on 2005-05-01
Last Modified: 2008-03-17
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.
Question by:thaburner
    1 Comment
    LVL 11

    Accepted Solution

    (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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    Title # Comments Views Activity
    fizzArray2 challenge 1 41
    maxMirror challenge 10 68
    Enhanced For loop vs ForEach Loop 4 42
    groovy example issue 10 32
    INTRODUCTION We all know how to code. But at times you simply want to insert a common code block into your existing code and amend it as per your requirements. This tool not only saves you time but also saves you the pain of typing it all out aga…
    I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now