• 考试界面


    Sub kaoshi(i As Integer)                                                                      

    With Sheet2

    '清空4个选项
    .OptionButton1.Value = False
    .OptionButton2.Value = False
    .OptionButton3.Value = False
    .OptionButton4.Value = False

    '写入题目
    .Label2.Caption = i
    .Label3.Caption = Sheet3.Range("a" & i + 1)
    .Label4.Caption = Sheet3.Range("b" & i + 1)
    .Label5.Caption = Sheet3.Range("c" & i + 1)
    .Label6.Caption = Sheet3.Range("d" & i + 1)
    .Label7.Caption = Sheet3.Range("e" & i + 1)

    '该隐藏的隐藏
    If .Label6.Caption = "" Then
    .OptionButton3.Visible = False
    Else
    .OptionButton3.Visible = True
    End If

    If .Label6.Caption = "" Then
    .OptionButton4.Visible = False
    Else
    .OptionButton4.Visible = True
    End If
    '返回之前的答案
    If Sheet3.Range("g" & i + 1) = "A" Then
    .OptionButton1.Value = True
    ElseIf Sheet3.Range("g" & i + 1) = "B" Then
    .OptionButton1.Value = True
    ElseIf Sheet3.Range("g" & i + 1) = "C" Then
    .OptionButton1.Value = True
    ElseIf Sheet3.Range("g" & i + 1) = "D" Then
    .OptionButton1.Value = True
    End If
    End With
    End Sub

    Private Sub CommandButton1_Click()

    Call kaoshi(1)
    Sheet2.SpinButton1.Value = 1
    End Sub

    Private Sub CommandButton2_Click()
    Call kaoshi(8)
    Sheet2.SpinButton1.Value = 8
    End Sub

    Private Sub OptionButton1_Click()
    Sheet3.Range("g" & Sheet2.SpinButton1.Value + 1) = "A"
    End Sub

    Private Sub OptionButton2_Click()
    Sheet3.Range("g" & Sheet2.SpinButton1.Value + 1) = "B"
    End Sub

    Private Sub OptionButton3_Click()
    Sheet3.Range("g" & Sheet2.SpinButton1.Value + 1) = "C"
    End Sub

    Private Sub OptionButton4_Click()
    Sheet3.Range("g" & Sheet2.SpinButton1.Value + 1) = "D"
    End Sub

    Private Sub SpinButton1_Change()
    Call kaoshi(Sheet2.SpinButton1.Value)
    End Sub

  • 相关阅读:
    【leetcode】ZigZag——easy
    联合
    AddChildViewController
    imageWithRender(图片的渲染模式)
    13.范型函数的使用:将字典合并到当前字典
    12.代码获取命名空间名称,并创建相应的类(anyClass 应用)
    13.static 面向对象
    11.swift 单例
    swift String 扩展
    swift UIView 扩展
  • 原文地址:https://www.cnblogs.com/lyzifan/p/12342757.html
Copyright © 2020-2023  润新知