热心网友
回答时间:2024-04-19 18:38
Private Sub Command1_Click() 密码登陆控件
Static Num As Integer 定义num静态数
If Num < 2 Then 密码只能输入两次内
If Text1.Text <> "Hys249078Azop^!" Then 密码是Hys249078Azop^!
Num = Num + 1 判断密码输入的次数
MsgBox "口令错误,请重新输入!", 64, "口令校对" 弹出提示窗口
Text1.SelStart = 0 文本控件开始为空
Text1.SelLength = Len(Text1.Text) 赋值,传递密码
Text1.SelText = ""
Text1.SetFocus
Else 密码正确,进去了
Load MainFrm ' 装载应用程序的主窗体
MainFrm.Show
Unload Form1 ' 卸除口令校对窗体
End If
Else
MsgBox "口令无效,请与管理员联系!", 16, "口令校对"
End
End If
End Sub
不会连上面都不懂吧!
Private Sub Command2_Click()
End 结束
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then 按回车键=点击按钮一
KeyAscii = 0
Command1.Value = 1
End If
End Sub
收起