📄 frmstudentcheck.frm
字号:
VERSION 5.00
Object = "{CFA7AFF4-3242-4269-9172-7389D695AE01}#1.0#0"; "stonexp.ocx"
Begin VB.Form frmStudentCheck
BorderStyle = 1 'Fixed Single
Caption = "学生信息查询"
ClientHeight = 1590
ClientLeft = 45
ClientTop = 435
ClientWidth = 5670
Icon = "frmStudentCheck.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 1590
ScaleWidth = 5670
Begin StoneXP.XPFrame XPFrame1
Height = 1575
Left = 0
TabIndex = 0
Top = 0
Width = 5655
_ExtentX = 9975
_ExtentY = 2778
Caption = ""
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Begin StoneXP.XPButton cmbCheck
Default = -1 'True
Height = 375
Left = 3600
TabIndex = 7
Top = 960
Width = 855
_ExtentX = 1508
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "查询"
MouseIcon = "frmStudentCheck.frx":06EA
MousePointer = 99
End
Begin VB.TextBox txtClass
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 5
Top = 960
Width = 1815
End
Begin VB.TextBox txtName
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3600
TabIndex = 4
Top = 360
Width = 1815
End
Begin VB.TextBox txtNo
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 2
Top = 360
Width = 1815
End
Begin StoneXP.XPButton cmbCancle
Height = 375
Left = 4560
TabIndex = 8
Top = 960
Width = 855
_ExtentX = 1508
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "取消"
MouseIcon = "frmStudentCheck.frx":0A04
MousePointer = 99
End
Begin VB.Label Label3
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "班级"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 255
Left = 240
TabIndex = 6
Top = 1080
Width = 855
End
Begin VB.Label Label2
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "姓名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 255
Left = 3000
TabIndex = 3
Top = 480
Width = 855
End
Begin VB.Label Label1
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "学号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 255
Left = 240
TabIndex = 1
Top = 480
Width = 855
End
End
End
Attribute VB_Name = "frmStudentCheck"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmbCancle_Click()
'按取消按钮时显示所有学生资料
QuaryString = "select * from student"
Unload Me
End Sub
Private Sub cmbCheck_Click()
Dim isFirst As Boolean '是否首条件标志
'判断是否输入查询条件
If Trim(txtNo.Text) = "" And Trim(txtName.Text) = "" And Trim(txtClass.Text) = "" Then
MsgBox "请输入查询条件!", vbOKOnly + vbExclamation, "提示"
Exit Sub
End If
'根据输入条件生成数据库查询语句(QuaryString)
isFirst = True
QuaryString = "select * from student where"
If Trim(txtNo.Text) <> "" Then '学号不为空
QuaryString = QuaryString & " Stu_Key='" & Trim(txtNo.Text) & "'"
isFirst = False
End If
If Trim(txtName.Text) <> "" Then '姓名不为空
If isFirst = False Then
QuaryString = QuaryString & " and Stu_Name='" & Trim(txtName.Text) & "'"
Else
QuaryString = QuaryString & " Stu_Name='" & Trim(txtName.Text) & "'"
isFirst = False
End If
End If
If Trim(txtClass.Text) <> "" Then '班级不为空
If isFirst = False Then
QuaryString = QuaryString & " and Stu_Class='" & Trim(txtClass.Text) & "'"
Else
QuaryString = QuaryString & " Stu_Class='" & Trim(txtClass.Text) & "'"
isFirst = False
End If
End If
Unload Me
End Sub
Private Sub Form_Load()
XPFrame1.BackColor = RGB(198, 229, 211) '设置背景色
Me.Left = frmMain.Left + (frmMain.Width - Me.Width) / 2 '设置窗体显示位置
Me.Top = frmMain.Top + (frmMain.Height - Me.Height) / 2 '设置窗体显示位置
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -