📄 frm_setstatus.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{57EA6131-FAB3-49C3-BF10-85A4777A5A7C}#1.0#0"; "XPButton.ocx"
Begin VB.Form frm_setstatus
BorderStyle = 0 'None
Caption = "学生学籍维护"
ClientHeight = 4575
ClientLeft = 0
ClientTop = 0
ClientWidth = 7500
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 305
ScaleMode = 3 'Pixel
ScaleWidth = 500
ShowInTaskbar = 0 'False
Begin XP_Button.XPButton command1
Height = 450
Index = 0
Left = 2925
TabIndex = 10
Top = 3555
Width = 915
_ExtentX = 1614
_ExtentY = 794
caption = "查询"
End
Begin VB.ComboBox Combo2
Height = 330
Left = 4485
TabIndex = 6
Top = 2805
Width = 2115
End
Begin VB.ComboBox Combo1
Height = 330
ItemData = "frm_setstatus.frx":0000
Left = 4485
List = "frm_setstatus.frx":0002
TabIndex = 5
Top = 2085
Width = 2115
End
Begin MSComctlLib.TreeView tvwStudentID
Height = 3315
Left = 465
TabIndex = 0
Top = 705
Width = 2355
_ExtentX = 4154
_ExtentY = 5847
_Version = 393217
Indentation = 882
LabelEdit = 1
LineStyle = 1
Sorted = -1 'True
Style = 7
FullRowSelect = -1 'True
SingleSel = -1 'True
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin XP_Button.XPButton command1
Height = 450
Index = 1
Left = 3945
TabIndex = 11
Top = 3555
Width = 915
_ExtentX = 1614
_ExtentY = 794
caption = "修改"
End
Begin XP_Button.XPButton command1
Height = 450
Index = 2
Left = 4965
TabIndex = 12
Top = 3555
Width = 915
_ExtentX = 1614
_ExtentY = 794
caption = "取消"
End
Begin XP_Button.XPButton command1
Height = 450
Index = 3
Left = 5985
TabIndex = 13
Top = 3555
Width = 915
_ExtentX = 1614
_ExtentY = 794
caption = "退出"
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "学籍设置"
ForeColor = &H8000000E&
Height = 345
Left = 615
TabIndex = 14
Top = 60
Width = 1800
End
Begin VB.Image imglefttitle
Height = 450
Left = 0
Picture = "frm_setstatus.frx":0004
Top = 0
Width = 450
End
Begin VB.Image imgleftbottom
Height = 450
Left = 0
Picture = "frm_setstatus.frx":0B0E
Top = 4140
Width = 450
End
Begin VB.Image imgrightbottom
Height = 450
Left = 7035
Picture = "frm_setstatus.frx":1618
Top = 4140
Width = 450
End
Begin VB.Image imgbottom
Height = 450
Left = 405
Picture = "frm_setstatus.frx":2122
Stretch = -1 'True
Top = 4140
Width = 6630
End
Begin VB.Image imgrightwindow
Height = 3765
Left = 7020
Picture = "frm_setstatus.frx":8A64
Stretch = -1 'True
Top = 420
Width = 465
End
Begin VB.Image imgleftwindow
Height = 3705
Left = 0
Picture = "frm_setstatus.frx":CD7E
Stretch = -1 'True
Top = 450
Width = 465
End
Begin VB.Image imgclose
Height = 240
Left = 6975
Picture = "frm_setstatus.frx":10330
Top = 60
Width = 240
End
Begin VB.Label Label4
BackColor = &H8000000E&
BorderStyle = 1 'Fixed Single
Height = 330
Left = 4485
TabIndex = 9
Top = 705
Width = 2115
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "学员编号:"
Height = 210
Index = 3
Left = 3225
TabIndex = 8
Top = 765
Width = 945
End
Begin VB.Label Label3
BackColor = &H8000000E&
BorderStyle = 1 'Fixed Single
Height = 330
Left = 4485
TabIndex = 7
Top = 1365
Width = 2115
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "当前状态:"
Height = 210
Index = 2
Left = 3225
TabIndex = 4
Top = 1425
Width = 945
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "学员编号:"
Height = 210
Left = 525
TabIndex = 3
Top = 480
Width = 945
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "新班编号:"
Height = 210
Index = 1
Left = 3225
TabIndex = 2
Top = 2865
Width = 945
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "更改状态:"
Height = 210
Index = 0
Left = 3225
TabIndex = 1
Top = 2145
Width = 945
End
Begin VB.Image imgtop
Height = 450
Left = 330
Picture = "frm_setstatus.frx":10672
Stretch = -1 'True
Top = -60
Width = 6810
End
Begin VB.Image imgrighttitle
Height = 525
Left = 7110
Picture = "frm_setstatus.frx":1B874
Top = -15
Width = 375
End
End
Attribute VB_Name = "frm_setstatus"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim myGrade As Cls_Grade
Dim myStatus As Cls_Status
Dim myStudent As Cls_student
Dim strSelectStudentID As String
Private Sub Combo1_Click()
If Trim(Combo1) = "毕业" Then
Combo2.Enabled = False
Combo2 = ""
command1(1).DragMode = 0
command1(1).Caption = "提交"
Else
Combo2.Enabled = True
End If
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii <> 13 Then KeyAscii = 0
End Sub
Private Sub Combo2_Click()
If Trim(Combo2) <> "" Then
command1(1).DragMode = 0
command1(1).Caption = "提交"
End If
End Sub
Private Sub Combo2_KeyPress(KeyAscii As Integer)
If KeyAscii <> 13 Then KeyAscii = 0
End Sub
Private Sub command1_Click(Index As Integer)
Dim i As Integer
Select Case Index
Case 0
'查询
frm_querystudentstatus.Show 1
'如果找到记录则处于可修改状态,反之处于待查状态
If finded = True Then
State "selected"
Else
State "cancel"
End If
Case 1
'更改
If command1(1).Caption = "修改" Then
State "edit"
Else
frm_ProgressBar.Show 1
'查找学员记录
Set myStudent = New Cls_student
myStudent.QryStudentByID strSelectStudentID
If myStudent.GetQryStudentRs.EOF = False Then
myStudent.GetQryStudentRs.Fields(16) = Trim(Combo1)
If Combo2.Enabled = True Then
myStudent.GetQryStudentRs.Fields(17) = Trim(Combo2)
End If
myStudent.GetQryStudentRs.Update
myStudent.GetQryStudentRs.Requery
End If
Set myStudent = Nothing
'刷新tvwStudentID
LoadStudentID
State "cancel"
End If
Case 2
State "cancel"
Case 3
Unload Me
End Select
End Sub
Private Sub Form_Load()
Dim i As Integer
SetWindow Me
AlwaysOnTop Me, False
Move (frm_main.Width - Me.Width) / 2, (frm_main.Height - Me.Height) / 2 - 800
'添加学员编号到tvwStudentID
LoadStudentID
Set myStatus = New Cls_Status
'将查询到的学籍添加到combo1中
myStatus.QueryStudentStatus
If myStatus.GetQryStudentStatus.EOF = False Then
Do Until myStatus.GetQryStudentStatus.EOF
Combo1.AddItem myStatus.GetQryStudentStatus.Fields(0)
myStatus.GetQryStudentStatus.MoveNext
Loop
End If
Set myStatus = Nothing
State "cancel"
End Sub
Private Sub tvwStudentID_NodeClick(ByVal Node As MSComctlLib.Node)
Set myStatus = New Cls_Status
Set myStudent = New Cls_student
'判断单击的是班级编号,还是学员编号
myStatus.PrcStatusPanDuanClass Node.Text
If myStatus.GetPrcStatusPanDuanClass.EOF = False Then
State "cancel"
Else
strSelectStudentID = Node.Text
myStudent.QryStudentByID strSelectStudentID
If myStudent.GetQryStudentRs.EOF = False Then Label3.Caption = myStudent.GetQryStudentRs.Fields(16)
Label4.Caption = strSelectStudentID
State "selected"
End If
Set myStatus = Nothing
Set myStudent = Nothing
End Sub
Private Sub State(kind As String)
'各种操作时各个控件的状态
Dim i As Integer
Select Case kind
Case "edit"
tvwStudentID.Enabled = False
Combo1.Enabled = True
Combo2.Enabled = False
command1(0).DragMode = 1
command1(1).DragMode = 1
command1(2).DragMode = 0
command1(3).DragMode = 1
Case "cancel"
tvwStudentID.Enabled = True
Label3.Caption = ""
Label4.Caption = ""
Combo1 = ""
Combo2 = ""
Combo1.Enabled = False
Combo2.Enabled = False
command1(1).Caption = "修改"
command1(0).DragMode = 0
command1(1).DragMode = 1
command1(2).DragMode = 1
command1(3).DragMode = 0
Case "selected"
tvwStudentID.Enabled = True
Combo1.Enabled = False
Combo2.Enabled = False
command1(0).DragMode = 0
command1(1).DragMode = 0
command1(2).DragMode = 1
command1(3).DragMode = 0
End Select
End Sub
Private Sub LoadStudentID()
Dim strTemp As String
Dim strNextTemp As String
tvwStudentID.Nodes.Clear
Combo2.Clear
'先查班级,再查班级内的学生
'查班级
Set myGrade = New Cls_Grade
myGrade.QueryGradeClassID
If myGrade.GetQryGradeClassID.EOF = False Then
strTemp = myGrade.GetQryGradeClassID.Fields(0)
tvwStudentID.Nodes.Add , tvwFirst, strTemp, strTemp
Combo2.AddItem strTemp
'按strtemp的值查询,将学员编号显示在子节点中
myGrade.PrcGradeStudentIDByClassID (strTemp)
If myGrade.GetGrade.EOF = False Then
Do Until myGrade.GetGrade.EOF
tvwStudentID.Nodes.Add strTemp, tvwChild, , myGrade.GetGrade.Fields(0)
myGrade.GetGrade.MoveNext
Loop
End If
myGrade.GetQryGradeClassID.MoveNext
Do Until myGrade.GetQryGradeClassID.EOF
strNextTemp = myGrade.GetQryGradeClassID.Fields(0)
tvwStudentID.Nodes.Add strTemp, tvwNext, strNextTemp, strNextTemp
Combo2.AddItem strNextTemp
'将班级中的学员编号显示在子节点中
myGrade.PrcGradeStudentIDByClassID (strNextTemp)
If myGrade.GetGrade.EOF = False Then
Do Until myGrade.GetGrade.EOF
tvwStudentID.Nodes.Add strNextTemp, tvwChild, , myGrade.GetGrade.Fields(0)
myGrade.GetGrade.MoveNext
Loop
End If
myGrade.GetQryGradeClassID.MoveNext
Loop
End If
Set myGrade = Nothing
End Sub
Private Sub imgclose_Click()
Unload Me
End Sub
Private Sub imglefttitle_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
DrawForms Me
End Sub
Private Sub imgtop_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
DrawForms Me
End Sub
Private Sub imgrighttitle_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
DrawForms Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -