新建From1(窗体),新建Text1(TextBox),Command1(按钮CommandButton),代码:
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
Private Sub Form_Load()
Dim myval As Long
myval = SystemParametersInfo(97, True, CStr(1), 0)
Text1.ToolTipText = "输入密码:12345"
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If Text1.Text = "12345" And KeyCode = vbKeyReturn Then
Dim myval As Long
myval = SystemParametersInfo(97, False, CStr(1), 0)
End
End If
End Sub
密码 12345