Public Class Form1
    Dim ti_mu(3) As String              ' 存放题目
    Dim Item(3, 4) As String        ' 存放A、B、C、D四个选择项
    '存放题目答案，1、2、3、4分别代表A、B、C、D 四个选择项
    Dim Answer(3) As Integer
    Dim s As Integer                    ' 题号
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ti_mu(1) = "计算机诞生于（   ）年"
        ti_mu(2) = "放置控件到窗体中的最迅速方法是（    ）"
        ti_mu(3) = "若窗体Form1的Text属性为frm，则其Load事件为（    ）"
        Item(1, 1) = "A.1944"
        Item(1, 2) = "B.1945"
        Item(1, 3) = "C.1946"
        Item(1, 4) = "D.1947"
        Item(2, 1) = "A.双击工具箱中的控件"
        Item(2, 2) = "B.单击工具箱中的控件"
        Item(2, 3) = "C.拖动鼠标"
        Item(2, 4) = "D.单击工具箱中的控件并拖动鼠标"
        Item(3, 1) = "A. Form_Load"
        Item(3, 2) = "B. Form1_Load"
        Item(3, 3) = "C. Frm_Load"
        Item(3, 4) = "D. Me_Load"
        Answer(1) = 2
        Answer(2) = 1
        Answer(3) = 1
        s = 1
        Call chu_ti(s)
    End Sub
    Private Sub chu_ti(ByVal n As Integer)
        Label1.Text = ti_mu(s)
        RadioButton1.Text = Item(s, 1)
        RadioButton2.Text = Item(s, 2)
        RadioButton3.Text = Item(s, 3)
        RadioButton4.Text = Item(s, 4)
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Answer(s) = 1 And RadioButton1.Checked Then
            MsgBox("恭喜，你选对了！")
        ElseIf Answer(s) = 2 And RadioButton2.Checked Then
            MsgBox("恭喜，你选对了！")
        ElseIf Answer(s) = 3 And RadioButton3.Checked Then
            MsgBox("恭喜，你选对了！")
        ElseIf Answer(s) = 4 And RadioButton4.Checked Then
            MsgBox("恭喜，你选对了！")
        Else
            MsgBox("选择错误！")
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        s = s + 1
        If s > 3 Then
            MsgBox("恭喜你，题目已经作完！")
        Else
            Call chu_ti(s)
        End If
    End Sub
End Class
