Results 1 to 6 of 6

Thread: [RESOLVED] Small Eye near password combo box

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2005
    Location
    Italy-Napoli
    Posts
    1,995

    Resolved [RESOLVED] Small Eye near password combo box

    I would like to insert a small Eye near a password combo box to show a password.
    Actially i use the "*" type font in password char.
    How to?
    Last edited by luca90; May 10th, 2020 at 01:02 AM.

  2. #2
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    7,409

    Re: Small Eye near password combo box

    So simple....create an 'eye' with an Image Control (size it as necessary).
    Set the PasswordChar to "*" in a textbox (ex:text1) in the IDE properties

    Use this code to reveal PWD when holding down on the image with the mouse button:

    Code:
    Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        Text1.PasswordChar = ""
    End Sub
    
    
    Private Sub Image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
        Text1.PasswordChar = "*"
    End Sub
    Sam I am (as well as Confused at times).

  3. #3
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,070

    Re: Small Eye near password combo box

    And to piggyback on Sam's idea... Luca, you said combo box, but did you mean text box?

    If you want the 'eye' to look like it's inside the text box, you can use 2 controls.
    Outer control: Picturebox, Appearance=Flat and backcolor same as the textbox back color
    Inside the picturebox
    - add textbox, make it borderless. Position top/left of the picturebox & make height same as picturebox inside size.
    - add 'eye' icon in picturebox positioned right of the textbox
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2005
    Location
    Italy-Napoli
    Posts
    1,995

    Re: Small Eye near password combo box

    Quote Originally Posted by LaVolpe View Post
    And to piggyback on Sam's idea... Luca, you said combo box, but did you mean text box?

    If you want the 'eye' to look like it's inside the text box, you can use 2 controls.
    Outer control: Picturebox, Appearance=Flat and backcolor same as the textbox back color
    Inside the picturebox
    - add textbox, make it borderless. Position top/left of the picturebox & make height same as picturebox inside size.
    - add 'eye' icon in picturebox positioned right of the textbox
    TKS Lavolpe. in effect is a textbox.
    tks for explain

  5. #5
    PowerPoster
    Join Date
    Feb 2017
    Posts
    2,265

    Re: [RESOLVED] Small Eye near password combo box

    For the eye, an alternative is to use a label, font Webdings and caption = "N".

  6. #6
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    7,409

    Re: [RESOLVED] Small Eye near password combo box

    Quote Originally Posted by Eduardo- View Post
    For the eye, an alternative is to use a label, font Webdings and caption = "N".
    Love that!
    Sam I am (as well as Confused at times).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width