VB考试怎么混?

来源:百度知道 编辑:UC知道 时间:2024/06/08 17:24:20
Structure student '定义一个用于存放学生信息的结构数组
Dim name As String '姓名
Dim num As String '学号
Dim sex As String '性别
Dim chin As String '存放语文成绩
Dim math As String '存放数学成绩
Dim comp As String '存放计算机成绩
End Structure
Dim stud(2) As student '班级总人数3

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer
For i = 0 To 2 '用于输入学生信息
stud(i).name = InputBox("输入第" & i + 1 & "位学生姓名")
stud(i).num = InputBox("输入第" & i + 1 & "位学生学号")
stud(i).sex = InputBox("输入第" & i + 1 & "位学生性别")
stud(i).chin = InputBox("输入第" & i + 1 & "位学生语文成绩")
stud(i).math = InputBox("输入第" & i + 1 & "位学生数学成绩")

Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows 窗体设计器生成的代码 "

Public Sub New()
MyBase.New()

'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()

'在 InitializeComponent() 调用之后添加任何初始化

End Sub

'窗体重写 dispose 以清理组件列表。
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer

'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
Friend WithEvents PictureBox3 As System.Windows.Forms.PictureBox
Friend With