使用inputbox時如何讓使用者輸入的資料以*出現
我只知道text.password = *這個有點類似
但是希望能告訴我inputbox要如何使用
2005-12-07 18:00:29 · 2 個解答 · 發問者 Anonymous in 電腦與網際網路 ➔ 程式設計
'以下在表單
Private Sub Command1_Click()
Dim hT As Long, L As Long, S As String
B = False
Str = "Test"
hT = CreateThread(ByVal 0&, ByVal 0&, AddressOf Chg, ByVal 0&, 0, L)
S = InputBox("請輸入密碼", Str)
MsgBox S
End Sub
'以下在模組
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Declare Function GetDlgItem Lib "user32" (ByVal hDlg As Long, ByVal nIDDlgItem As Long) As Long
Declare Function CreateThread Lib "kernel32" (ByVal lpThreadAttributes As Any, ByVal dwStackSize As Long, ByVal lpStartAddress As Long, ByVal lpParameter As Any, ByVal dwCreationFlags As Long, lpThreadID As Long) As Long
Const EM_SETPASSWORDCHAR = &HCC
Public B As Boolean, Str As String
Public Sub Chg()
Do Until B
Dim H As Long, S As Long
H = FindWindow("#32770", Str)
If H <> 0 Then
S = GetDlgItem(H, &H1324)
If S <> 0 Then
SendMessage S, EM_SETPASSWORDCHAR, Asc("*"), 0
B = True
End If
End If
Loop
End Sub
2005-12-07 18:20:13 · answer #1 · answered by W.J.S. 7 · 0⤊ 0⤋
http://vb.infoserv.com.tw/
這網站有滿多資料的~~看能不能幫到你~
2005-12-07 18:03:03 · answer #2 · answered by Anonymous · 0⤊ 0⤋