📄 frms.frm
字号:
VERSION 5.00
Begin VB.Form FrmSL
BorderStyle = 3 'Fixed Dialog
Caption = "学生管理"
ClientHeight = 1365
ClientLeft = 2760
ClientTop = 2580
ClientWidth = 3915
Icon = "FrmS.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1365
ScaleWidth = 3915
ShowInTaskbar = 0 'False
Begin VB.TextBox txtPwd
ForeColor = &H000000FF&
Height = 270
IMEMode = 3 'DISABLE
Left = 1200
MaxLength = 16
PasswordChar = "*"
TabIndex = 1
Top = 600
Width = 2175
End
Begin VB.TextBox txtNum
ForeColor = &H00FF0000&
Height = 270
Left = 1200
MaxLength = 16
TabIndex = 0
Top = 120
Width = 2175
End
Begin VB.CommandButton cmdOK
Cancel = -1 'True
Caption = "返回(&R)"
Height = 275
Index = 1
Left = 2880
TabIndex = 3
Top = 1005
Width = 855
End
Begin VB.CommandButton cmdOK
Caption = "确认(&O)"
Height = 275
Index = 0
Left = 1680
TabIndex = 2
Top = 1005
Width = 855
End
Begin VB.Label lblPwd
AutoSize = -1 'True
Caption = "密 码"
ForeColor = &H8000000D&
Height = 180
Left = 480
TabIndex = 5
Top = 645
Width = 450
End
Begin VB.Label lblName
AutoSize = -1 'True
Caption = "学 号"
ForeColor = &H8000000D&
Height = 180
Left = 480
TabIndex = 4
Top = 165
Width = 450
End
End
Attribute VB_Name = "FrmSL"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdOK_Click(Index As Integer)
If Index = 1 Then Unload Me: Load FrmMain: FrmMain.Show: Exit Sub
QueryInfo ("select * from readers where readerid='" & Choose(txtNum.Text) & "'")
If DBRct.EOF Then MsgBox "用户名不存在!", vbInformation, "出错": Exit Sub
DBRct.MoveFirst
FrmSL.Hide
If DBRct.Fields("pwd").Value = Choose(txtpwd) Then
MsgBox "登陆信息" & Chr(13) & "姓 名:" & DBRct.Fields("readername").Value & Chr(10) & "学 号:" & txtNum, vbInformation + vbOKOnly, "基本信息"
Unload Me: Load frmStu: frmStu.Show: Exit Sub
Else
MsgBox "输入的操作员名或口令非法!" & vbCrLf & "请注意大小写,重新输入吗?", vbInformation, "登陆失败"
txtpwd = ""
End If
FrmSL.Show
End Sub
Private Sub cmdOk_KeyPress(Index As Integer, KeyAscii As Integer)
If Chr(KeyAscii) = "o" Or Chr(KeyAscii) = "O" Then cmdOK_Click (0)
If Chr(KeyAscii) = "r" Or Chr(KeyAscii) = "R" Then cmdOK_Click (1)
End Sub
Private Sub Form_Load()
Unload FrmMain
If QueryInfo("select * from Readers") = False Then End
DBRct.MoveFirst
cmdOK(0).Enabled = False
End Sub
Private Sub txtNum_change()
If txtpwd.Text <> "" And txtNum.Text <> "" Then
cmdOK(0).Enabled = True
Else: cmdOK(0).Enabled = False
End If
End Sub
Private Sub txtpwd_Change()
If txtpwd.Text <> "" And txtNum.Text <> "" Then
cmdOK(0).Enabled = True
Else: cmdOK(0).Enabled = False
End If
End Sub
Private Sub txtpwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then cmdOK_Click (0)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -