📄 form9.frm
字号:
VERSION 5.00
Begin VB.Form Form9
Caption = "Form9"
ClientHeight = 3750
ClientLeft = 60
ClientTop = 450
ClientWidth = 6270
LinkTopic = "Form9"
ScaleHeight = 3750
ScaleWidth = 6270
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "退出"
Height = 495
Left = 4680
TabIndex = 6
Top = 2760
Width = 1335
End
Begin VB.TextBox txtUsername
Height = 375
Left = 1560
TabIndex = 5
Top = 720
Width = 1695
End
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 495
Left = 4680
TabIndex = 3
Top = 1680
Width = 1335
End
Begin VB.TextBox txtPassword
Height = 375
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 1
Top = 1680
Width = 1695
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Height = 495
Left = 4680
TabIndex = 0
Top = 600
Width = 1335
End
Begin VB.Label Label2
Caption = "管理员名(&U):"
Height = 495
Left = 240
TabIndex = 4
Top = 720
Width = 1335
End
Begin VB.Label Label1
Caption = "密码(M):"
Height = 255
Left = 240
TabIndex = 2
Top = 1800
Width = 855
End
End
Attribute VB_Name = "Form9"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Const username As String = "xiaoran"
Const password As String = "manyue"
Private Sub cmdCancel_Click()
txtUsername.Text = ""
txtPassword.Text = ""
txtUsername.SetFocus
End Sub
Private Sub cmdOK_Click()
Dim i As Integer
Static n As Integer
If txtUsername.Text = username And txtPassword.Text = password Then
Form2.Show
Unload Form1
Unload Me
Else
n = n + 1
If n < 3 Then
i = MsgBox("用户名或密码错误,请重新输入!", vbCritical + vbRetryCancel + vbDefaultButton1, "登录失败")
If i = vbRetry Then
txtUsername.Text = ""
txtPassword.Text = ""
txtUsername.SetFocus
Else
End
End If
Else
MsgBox "三次错误,请退出!", vbOKOnly + vbExclamation, "登录失败"
End
End If
End If
End Sub
Private Sub Command1_Click()
Unload Me
Form1.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -