Results 1 to 8 of 8

Thread: Make input box ***ed

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2001
    Posts
    54

    Make input box ***ed

    How do you set it so that the values being entered into an input box are able to have a certain character replacing them such as "*********"?

  2. #2
    Lively Member
    Join Date
    Jun 2002
    Posts
    81
    change the textbox property "passwordchar" to something else then "*"

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2001
    Posts
    54
    Not a textbox, but an inputbox. The inputbox doesn't have properties in the same sense as a textbox does.

  4. #4
    Lively Member
    Join Date
    Jun 2002
    Posts
    81
    then why not creating a new form with a textbox and using that instead?

  5. #5

    Thread Starter
    Member
    Join Date
    Oct 2001
    Posts
    54
    Because I'm using Visual Basic for Applications (VBA) and I'm trying to create system that locks and unlocks items and the forms don't provide the level of control that this does with VBA.

  6. #6
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819
    you can probably do it with api's. I have no idea how though.

  7. #7

    Thread Starter
    Member
    Join Date
    Oct 2001
    Posts
    54
    Darn. Does anyone know how to do it with API's?

  8. #8
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Try this

    VB Code:
    1. 'set the input of an input box to password characters
    2.  
    3.  
    4. '---bas module code--
    5.  
    6. Option Explicit
    7.  
    8. Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    9.  
    10. Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    11.  
    12. Public Declare Function SetTimer& Lib "user32" (ByVal hwnd&, ByVal nIDEvent&, ByVal uElapse&, ByVal lpTimerFunc&)
    13.  
    14. Public Declare Function KillTimer& Lib "user32" (ByVal hwnd&, ByVal nIDEvent&)
    15. Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    16. Public Const NV_INPUTBOX As Long = &H5000&
    17. Public Const EM_SETPASSWORDCHAR = &HCC
    18. Public Sub TimerProc(ByVal hwnd&, ByVal uMsg&, ByVal idEvent&, ByVal dwTime&)
    19.     Dim myHwnd As Long
    20. 'Change here App.Title (defoult InputBox Caption) into your caption
    21.     myHwnd = FindWindowEx(FindWindow("#32770", App.Title), 0, "Edit", "")
    22.      Call SendMessage(myHwnd, EM_SETPASSWORDCHAR, 42, 0)
    23.     KillTimer hwnd, idEvent
    24. End Sub
    25.  
    26. '--Using - form code:
    27. Private Sub Command1_Click()
    28. Dim sPass As String
    29. SetTimer hwnd, NV_INPUTBOX, 10, AddressOf TimerProc
    30. sPass = InputBox("Set Password")
    31. End Sub
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

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