practice5_71.frm
来自「深圳大学的vb上机与教学的课件」· FRM 代码 · 共 89 行
FRM
89 行
VERSION 5.00
Begin VB.Form Form1
Caption = "口令检测"
ClientHeight = 2160
ClientLeft = 60
ClientTop = 345
ClientWidth = 4215
Icon = "practice5_71.frx":0000
LinkTopic = "Form1"
ScaleHeight = 2160
ScaleWidth = 4215
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command1
Caption = "确定(&Y)"
Height = 495
Left = 1320
TabIndex = 2
Top = 1320
Width = 1695
End
Begin VB.TextBox Text1
Height = 495
IMEMode = 3 'DISABLE
Left = 1920
MaxLength = 8
PasswordChar = "*"
TabIndex = 1
Top = 480
Width = 1935
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "请输入口令:"
Height = 180
Left = 720
TabIndex = 0
Top = 600
Width = 990
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim I As Integer
Private Sub Command1_Click()
kl = UCase(Trim(Text1.Text))
If kl = "ABCD" Then
I = 0
Form2.Show
Else
If I >= 2 Then
MsgBox "对不起,您不能使用本系统"
End
Else
Form1.Caption = "口令错,请重新输入"
I = I + 1
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End If
End If
End Sub
Private Sub Text1_Change()
Form1.Caption = ""
End Sub
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
kl = UCase(Trim(Text1.Text))
If kl = "ABCD" Then
I = 0
Form2.Show
Else
If I >= 2 Then
MsgBox "对不起,您不能使用本系统"
End
Else
Form1.Caption = "口令错,请重新输入"
I = I + 1
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End If
End If
End If
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?