|
-
Jun 15th, 2002, 08:28 AM
#1
Thread Starter
Member
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 "*********"?
-
Jun 15th, 2002, 08:31 AM
#2
Lively Member
change the textbox property "passwordchar" to something else then "*"
-
Jun 15th, 2002, 08:37 AM
#3
Thread Starter
Member
Not a textbox, but an inputbox. The inputbox doesn't have properties in the same sense as a textbox does.
-
Jun 15th, 2002, 08:39 AM
#4
Lively Member
then why not creating a new form with a textbox and using that instead?
-
Jun 15th, 2002, 08:44 AM
#5
Thread Starter
Member
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.
-
Jun 15th, 2002, 08:50 AM
#6
PowerPoster
you can probably do it with api's. I have no idea how though.
-
Jun 15th, 2002, 12:01 PM
#7
Thread Starter
Member
Darn. Does anyone know how to do it with API's?
-
Jun 15th, 2002, 12:18 PM
#8
PowerPoster
Well
Try this
VB Code:
'set the input of an input box to password characters
'---bas module code--
Option Explicit
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
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
Public Declare Function SetTimer& Lib "user32" (ByVal hwnd&, ByVal nIDEvent&, ByVal uElapse&, ByVal lpTimerFunc&)
Public Declare Function KillTimer& Lib "user32" (ByVal hwnd&, ByVal nIDEvent&)
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
Public Const NV_INPUTBOX As Long = &H5000&
Public Const EM_SETPASSWORDCHAR = &HCC
Public Sub TimerProc(ByVal hwnd&, ByVal uMsg&, ByVal idEvent&, ByVal dwTime&)
Dim myHwnd As Long
'Change here App.Title (defoult InputBox Caption) into your caption
myHwnd = FindWindowEx(FindWindow("#32770", App.Title), 0, "Edit", "")
Call SendMessage(myHwnd, EM_SETPASSWORDCHAR, 42, 0)
KillTimer hwnd, idEvent
End Sub
'--Using - form code:
Private Sub Command1_Click()
Dim sPass As String
SetTimer hwnd, NV_INPUTBOX, 10, AddressOf TimerProc
sPass = InputBox("Set Password")
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|