📄 form5.frm
字号:
VERSION 5.00
Begin VB.Form Form5
Caption = "学生成绩统计"
ClientHeight = 8595
ClientLeft = 1740
ClientTop = 1695
ClientWidth = 11880
LinkTopic = "Form5"
ScaleHeight = 8595
ScaleWidth = 11880
Begin VB.TextBox txt
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Index = 0
Left = 1560
TabIndex = 10
Top = 1800
Width = 735
End
Begin VB.CommandButton com1
Caption = "统 计"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6240
TabIndex = 7
Top = 840
Width = 1815
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3960
TabIndex = 5
Top = 840
Width = 735
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 390
Left = 1440
TabIndex = 2
Top = 840
Width = 735
End
Begin VB.Label Lab
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 0
Left = 120
TabIndex = 9
Top = 1920
Width = 1335
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "(说明:若缺考,请在对应文本框内输入“缺考”或不填写任何内容!)"
Height = 180
Left = 240
TabIndex = 8
Top = 1440
Width = 5760
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "人"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 4800
TabIndex = 6
Top = 960
Width = 225
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "实考人数"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 3000
TabIndex = 4
Top = 960
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "人"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 2280
TabIndex = 3
Top = 960
Width = 225
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "应考人数"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 480
TabIndex = 1
Top = 960
Width = 900
End
Begin VB.Label Label1
Alignment = 2 'Center
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 525
Left = 960
TabIndex = 0
Top = 120
Width = 7380
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub com1_Click()
Form5.Visible = False
Form7.Visible = True
Dim int1 As Integer
Dim int2 As Integer
Dim int3 As Integer
Dim int4 As Integer
Dim int5 As Integer
Dim int6 As Integer
Dim int7 As Integer
Dim int8 As Integer
Dim int9 As Integer
Dim int10 As Integer
Dim int11 As Integer
Dim int12 As String
Dim int13 As Integer
Dim int14 As Integer
Dim int15 As Integer
Dim int16 As Integer
Dim int17 As Integer
Dim int18 As Integer
Dim int19 As Integer
Dim int20 As Integer
Dim int21 As Integer
int1 = Form4.Text1.Text
int2 = int1 - 1
int3 = int1 - int2
Do Until int3 = int1
If txt(int3 - 1).Text = "缺考" Then
txt(int3 - 1).Text = 0
End If
If txt(int3).Text = "缺考" Then
txt(int3).Text = 0
End If
int3 = int3 + 1
Loop
int1 = Form4.Text1.Text
int2 = int1 - 1
int3 = int1 - int2
int8 = txt(int3 - 1).Text
Do Until int3 = int1
int4 = int8
int5 = txt(int3).Text
If int4 > int5 Or int4 = int5 Then
int8 = int4
int7 = int5
ElseIf int4 < int5 Then
int8 = int5
int7 = int4
End If
int3 = int3 + 1
Loop
int1 = Form4.Text1.Text
int2 = int1 - 1
int3 = int1 - int2
int7 = txt(int3 - 1).Text
Do Until int3 = int1
int4 = int7
int5 = txt(int3).Text
If int4 > int5 Or int4 = int5 Then
int7 = int5
ElseIf int4 < int5 Then
int7 = int4
End If
int3 = int3 + 1
Loop
int1 = Form4.Text1.Text
int2 = int1 - 1
int3 = int1 - int2
int11 = 0
Do Until int3 - 1 = int1
int10 = txt(int3 - 1).Text
int11 = int10 + int11
int3 = int3 + 1
Loop
int1 = Form4.Text1.Text
int2 = int1 - 1
int3 = int1 - int2
Do Until int3 - 1 = int1
If txt(int3 - 1).Text > 89 Then
int12 = int12 + 1
ElseIf txt(int3 - 1).Text > 79 Then
int13 = int13 + 1
ElseIf txt(int3 - 1).Text > 69 Then
int14 = int14 + 1
ElseIf txt(int3 - 1).Text > 59 Then
int15 = int15 + 1
ElseIf txt(int3 - 1).Text < 60 Then
int16 = int16 + 1
End If
int3 = int3 + 1
Loop
int17 = (int12 / int1) * 100
int18 = (int13 / int1) * 100
int19 = (int14 / int1) * 100
int20 = (int15 / int1) * 100
int21 = (int16 / int1) * 100
Form7.Label26.Caption = int8
Form7.Label27.Caption = int7
Form7.Label28.Caption = int11 / int1
Form7.Label9.Caption = int12
Form7.Label10.Caption = int13
Form7.Label11.Caption = int14
Form7.Label12.Caption = int15
Form7.Label13.Caption = int16
Form7.Label14.Caption = int17 & "%"
Form7.Label15.Caption = int18 & "%"
Form7.Label16.Caption = int19 & "%"
Form7.Label17.Caption = int20 & "%"
Form7.Label18.Caption = int21 & "%"
End Sub
Private Sub Form_Load()
If Form3.Option1.Value = True Then
Dim str1 As String
Dim n As Integer
Dim int1 As Integer
Dim int2 As Integer
Dim int3 As Integer
Dim int4 As Integer
Dim int5 As Integer
Dim int6 As Integer
Dim int7 As Integer
Dim int8 As Integer
Dim int9 As Integer
Dim int10 As Integer
Dim int11 As Integer
Dim int12 As Integer
Dim int13 As Integer
Form5.Move 50, 50
Label1.Caption = Form3.Text1.Text + "班" + "《" + Form3.Text2.Text + "》(" + Form3.Text3.Text + "学分)考试成绩"
Text1.Text = Form4.Text1.Text
Text2.Text = Form4.Text2.Text
int1 = Form4.Text1.Text
Lab(0).Move 120, 1920
txt(0).Move 1560, 1800
int2 = int1 - 1
int3 = int1 - int2
int4 = int1
int5 = 2380
int6 = 120
int7 = 1920
int8 = 5
int9 = 450
int10 = 1560
int11 = 1800
Lab(0).Caption = Form3.Text1.Text & "01"
Do Until int3 = int1
If int3 Mod 5 = 0 And int3 / 5 >= 0 Then
int6 = -2260
int10 = -820
int7 = int7 + int9
int11 = int11 + int9
End If
Load Lab(int3)
Load txt(int3)
Lab(int3).Visible = True
txt(int3).Visible = True
Lab(int3).Move int6 + int5, int7
txt(int3).Move int10 + int5, int11
If int3 <= 8 Then
Lab(int3).Caption = Form3.Text1.Text & "0" & int3 + 1
Else
Lab(int3).Caption = Form3.Text1.Text & int3 + 1
End If
int3 = int3 + 1
int6 = int6 + int5
int10 = int10 + int5
Loop
Else
Form5.Move 50, 50
int3 = 0
Input #1, str1
txt(int3).Text = str1
int3 = int3 + 1
End If
End Sub
Private Sub txt_LostFocus(Index As Integer)
Dim int1 As Integer
Dim int2 As Integer
Dim int3 As Integer
Dim int4 As Integer
Dim int5 As Integer
int1 = Form4.Text1.Text
int3 = Index
If txt(int3).Text = "" Then
txt(int3).Text = "缺考"
txt(int3).ForeColor = vbBlue
ElseIf txt(int3).Text = "缺考" Then
txt(int3).ForeColor = vbBlue
ElseIf txt(int3).Text >= 0 And txt(int3).Text < 60 Then
txt(int3).ForeColor = vbRed
ElseIf txt(int3).Text < 0 Or txt(int3).Text > 100 Then
Form6.Visible = True
ElseIf txt(int3).Text >= 60 And txt(int3).Text <= 100 Then
txt(int3).ForeColor = vbBlack
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -