📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form FrmLogin
Caption = "登录"
ClientHeight = 3120
ClientLeft = 60
ClientTop = 450
ClientWidth = 5070
LinkTopic = "Form1"
ScaleHeight = 3120
ScaleWidth = 5070
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Cmdcancel_click
Caption = "取消"
Height = 495
Left = 2880
TabIndex = 5
Top = 2160
Width = 1215
End
Begin VB.CommandButton Cmdok_click
Caption = "确定"
Height = 495
Left = 960
TabIndex = 4
Top = 2160
Width = 1215
End
Begin VB.TextBox txtpassword
Height = 495
Left = 1800
TabIndex = 3
Top = 1200
Width = 2535
End
Begin VB.TextBox txtname
Height = 495
Left = 1800
TabIndex = 2
Top = 360
Width = 2535
End
Begin VB.Label Label2
Caption = "密码"
Height = 495
Left = 360
TabIndex = 1
Top = 1320
Width = 1215
End
Begin VB.Label Label1
Caption = "输入人名"
Height = 495
Left = 360
TabIndex = 0
Top = 480
Width = 1215
End
End
Attribute VB_Name = "FrmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public loginsucceeded As Boolean
Private Sub Cmdcancel_click_Click()
loginsucceeded = False
Me.Hide
End
End Sub
Private Sub Cmdok_click_Click()
Dim i As Integer
loginsucceeded = False
If txtpassword.Text = "123" Then
For i = 1 To 10
If txtname.Text = arrname(i) Then
loginsucceeded = True
Exit For
End If
Next i
If loginsucceeded = True Then
Me.Hide
Frmqueery.Show
Else
MsgBox "查无此人,请重新查询", , "警告"
End If
Else
MsgBox "无效的密码,再试一次!", , "登录"
txtpassword.SetFocus
SendKeys "{home}+{end}"
End If
End Sub
Private Sub Form_Load()
Dim i As Integer
For i = 1 To 10
arrname(i) = "p" & i
Next i
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -