📄 frm_statmark.frm
字号:
VERSION 5.00
Object = "{57EA6131-FAB3-49C3-BF10-85A4777A5A7C}#1.0#0"; "XPButton.ocx"
Begin VB.Form frm_statmark
BorderStyle = 0 'None
Caption = "成绩统计"
ClientHeight = 3765
ClientLeft = 0
ClientTop = 0
ClientWidth = 7185
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 = 251
ScaleMode = 3 'Pixel
ScaleWidth = 479
ShowInTaskbar = 0 'False
Begin XP_Button.XPButton command2
Height = 405
Left = 3840
TabIndex = 19
Top = 2790
Width = 1185
_ExtentX = 2090
_ExtentY = 714
caption = "取消"
End
Begin XP_Button.XPButton command1
Height = 405
Left = 1980
TabIndex = 18
Top = 2790
Width = 1185
_ExtentX = 2090
_ExtentY = 714
caption = "统计"
End
Begin VB.ComboBox Combo2
Height = 330
Left = 465
Style = 2 'Dropdown List
TabIndex = 3
Top = 2100
Width = 1980
End
Begin VB.ComboBox Combo1
Height = 330
ItemData = "frm_statmark.frx":0000
Left = 465
List = "frm_statmark.frx":0002
Style = 2 'Dropdown List
TabIndex = 1
Top = 1080
Width = 1980
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "成绩统计"
ForeColor = &H8000000E&
Height = 345
Index = 3
Left = 615
TabIndex = 21
Top = 90
Width = 1155
End
Begin VB.Image imgrightwindow
Height = 2955
Left = 6720
Picture = "frm_statmark.frx":0004
Stretch = -1 'True
Top = 420
Width = 450
End
Begin VB.Image imgclose
Height = 240
Left = 6780
Picture = "frm_statmark.frx":431E
Top = 105
Width = 240
End
Begin VB.Image imgrighttitle
Height = 525
Left = 6780
Picture = "frm_statmark.frx":4660
Top = 0
Width = 375
End
Begin VB.Label Label5
Alignment = 2 'Center
BackColor = &H8000000E&
Height = 285
Index = 0
Left = 5010
TabIndex = 20
Top = 1080
Width = 660
End
Begin VB.Image imglefttitle
Height = 450
Left = 0
Picture = "frm_statmark.frx":5106
Top = 0
Width = 450
End
Begin VB.Image imgleftbottom
Height = 450
Left = 0
Picture = "frm_statmark.frx":5C10
Top = 3300
Width = 450
End
Begin VB.Image imgrightbottom
Height = 450
Left = 6705
Picture = "frm_statmark.frx":671A
Top = 3300
Width = 450
End
Begin VB.Image imgbottom
Height = 450
Left = 450
Picture = "frm_statmark.frx":7224
Stretch = -1 'True
Top = 3300
Width = 6255
End
Begin VB.Image imgleftwindow
Height = 2895
Left = 0
Picture = "frm_statmark.frx":DB66
Stretch = -1 'True
Top = 420
Width = 465
End
Begin VB.Label Label6
Alignment = 2 'Center
BackColor = &H8000000E&
Height = 285
Index = 2
Left = 5925
TabIndex = 17
Top = 2145
Width = 660
End
Begin VB.Label Label6
Alignment = 2 'Center
BackColor = &H8000000E&
Height = 285
Index = 1
Left = 5925
TabIndex = 16
Top = 1605
Width = 660
End
Begin VB.Label Label6
Alignment = 2 'Center
BackColor = &H8000000E&
Height = 285
Index = 0
Left = 5940
TabIndex = 15
Top = 1080
Width = 660
End
Begin VB.Label Label5
Alignment = 2 'Center
BackColor = &H8000000E&
Height = 285
Index = 2
Left = 5010
TabIndex = 14
Top = 2145
Width = 660
End
Begin VB.Label Label5
Alignment = 2 'Center
BackColor = &H8000000E&
Height = 285
Index = 1
Left = 5010
TabIndex = 13
Top = 1605
Width = 660
End
Begin VB.Label Label4
Alignment = 2 'Center
BackColor = &H8000000E&
Height = 285
Index = 2
Left = 4050
TabIndex = 12
Top = 2145
Width = 660
End
Begin VB.Label Label4
Alignment = 2 'Center
BackColor = &H8000000E&
Height = 285
Index = 1
Left = 4050
TabIndex = 11
Top = 1605
Width = 660
End
Begin VB.Label Label4
Alignment = 2 'Center
BackColor = &H8000000E&
Height = 285
Index = 0
Left = 4050
TabIndex = 10
Top = 1080
Width = 660
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "平均分"
Height = 210
Index = 2
Left = 5925
TabIndex = 9
Top = 660
Width = 630
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "优秀率"
Height = 210
Index = 1
Left = 5010
TabIndex = 8
Top = 660
Width = 630
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "及格率"
Height = 210
Index = 0
Left = 4065
TabIndex = 7
Top = 660
Width = 630
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "笔试成绩:"
Height = 210
Index = 2
Left = 2865
TabIndex = 6
Top = 2220
Width = 945
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "平时成绩:"
Height = 210
Index = 1
Left = 2865
TabIndex = 5
Top = 1680
Width = 945
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "上机成绩:"
Height = 210
Index = 0
Left = 2865
TabIndex = 4
Top = 1140
Width = 945
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "课程编号:"
Height = 210
Index = 1
Left = 465
TabIndex = 2
Top = 1680
Width = 1050
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "班级编号:"
Height = 210
Index = 0
Left = 465
TabIndex = 0
Top = 660
Width = 1050
End
Begin VB.Image imgtop
Height = 450
Left = 420
Picture = "frm_statmark.frx":11118
Stretch = -1 'True
Top = 0
Width = 6390
End
End
Attribute VB_Name = "frm_statmark"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim myGrade As Cls_Grade
Dim myGrade2 As Cls_Grade
Dim myUser As Cls_user
Private Sub Combo1_Click()
Combo2.Enabled = True
Combo2.Clear
Set myGrade = New Cls_Grade
'按combo1的值查询,将课程编号显示在combo2中
myGrade.PrcGradeSemIDByClassID Trim(Combo1)
If myGrade.GetGrade.EOF = False Then
Do Until myGrade.GetGrade.EOF
Combo2.AddItem Trim(myGrade.GetGrade.Fields(0))
myGrade.GetGrade.MoveNext
Loop
End If
Set myGrade = Nothing
command1.DragMode = 1
End Sub
Private Sub Combo2_Click()
Dim i As Integer
command1.DragMode = 0
For i = 0 To 2
Label4(i).Caption = ""
Label5(i).Caption = ""
Label6(i).Caption = ""
Next
End Sub
Private Sub Combo2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then command1_Click
End Sub
Private Sub command1_Click()
Dim i As Integer
Dim sum(3) As Integer
Dim StudentNumber As Integer '总人数
Dim jige(3) As Integer '及格人数
Dim youxiu(3) As Integer '优秀人数
If Combo1 <> "" Or Combo2 <> "" Then
Set myGrade2 = New Cls_Grade
myGrade2.PrcGradeStat Trim(Combo1)
Do Until myGrade2.GetGrade.EOF
If Trim(Combo2) = Trim(myGrade2.GetGrade.Fields(1)) Then
For i = 0 To 2
If Val(myGrade2.GetGrade.Fields(i + 2)) >= 80 Then
youxiu(i) = youxiu(i) + 1
Else
If Val(myGrade2.GetGrade.Fields(i + 2)) >= 40 Then jige(i) = jige(i) + 1
End If
sum(i) = sum(i) + Val(myGrade2.GetGrade.Fields(i + 2))
Next
StudentNumber = StudentNumber + 1
End If
myGrade2.GetGrade.MoveNext
Loop
Set myGrade2 = Nothing
For i = 0 To 2
If StudentNumber <> 0 Then
Label4(i).Caption = Format$(jige(i) / StudentNumber, "0.0%")
Label5(i).Caption = Format$(youxiu(i) / StudentNumber, "0.0%")
Label6(i).Caption = Format$(sum(i) / StudentNumber, "0.0")
End If
Next
End If
End Sub
Private Sub command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim i As Integer
SetWindow Me
AlwaysOnTop Me, False
Set myGrade = New Cls_Grade
Set myUser = New Cls_user
Move (frm_main.Width - Me.Width) / 2, (frm_main.Height - Me.Height) / 2 - 800
'显示班级编号在combo1中
myUser.OpenUserMessageByUserID UserID
If myUser.GetUserMessageRs.EOF = False Then
If Trim(myUser.GetUserMessageRs.Fields(3)) = "总监" Then
myGrade.QueryGradeClassID
If myGrade.GetQryGradeClassID.EOF = False Then
Do Until myGrade.GetQryGradeClassID.EOF
Combo1.AddItem Trim(myGrade.GetQryGradeClassID.Fields(0))
myGrade.GetQryGradeClassID.MoveNext
Loop
End If
ElseIf Trim(myUser.GetUserMessageRs.Fields(3)) = "教员" Then
myUser.OpenConnectByUserID UserID
If myUser.GetUserMessageRs.EOF = False Then
Do Until myUser.GetUserMessageRs.EOF
Combo1.AddItem Trim(myUser.GetUserMessageRs.Fields(2))
myUser.GetUserMessageRs.MoveNext
Loop
End If
End If
End If
Set myUser = Nothing
Set myGrade = Nothing
Combo2.Enabled = False
command1.DragMode = 1
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 + -