zoukankan      html  css  js  c++  java
  • C语言经典题库V2.1

    C语言经典题库V2.1,‎September ‎28, ‎2018那天晚上写的新版本。

    一个ExcelVBA的项目,功能是能够从题库中随机抽题,并利用了新版(即07年往后)的office的UI。

    UI配置文件(customUI.xml):

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
    
        <ribbon startFromScratch="true">
    
            <tabs>
    
                <tab id="myTab" label="C Language">
    
    
    
    <group id="g1" label="Rnd">
    
        <button id="r5" label="Rnd_5" imageMso="BorderBottomNoToggle" size="large" supertip="Rand_5" onAction="act11"/>
    
        <button id="r10" label="Rnd_10" imageMso="BorderDoubleBottom" size="large" supertip="Rand_10" onAction="act12"/>
    
        <button id="r20" label="Rnd_20" imageMso="AlignBottomExcel" size="large" supertip="Rand_20" onAction="act13"/>
    
        <button id="r40" label="Rnd_40" imageMso="AlignCenter" size="large" supertip="Rand_40" onAction="act14"/>
    </group>
    <group id="g2" label="More">
    
        <button id="finish" label="finish" imageMso="Spelling" size="large" onAction="act21"/>
        <button id="about" label="about" imageMso="FunctionsLogicalInsertGallery" size="large" onAction="act22"/>
    </group>
    
    
                </tab>
    
            </tabs>
    
        </ribbon>
    
    </customUI>

    act模块(主模块):

    Public Sub act11(a11 As IRibbonControl)
        Call RndFind(5)
    End Sub
    
    Public Sub act12(a12 As IRibbonControl)
        Call RndFind(10)
    End Sub
    
    Public Sub act13(a13 As IRibbonControl)
        Call RndFind(20)
    End Sub
    
    Public Sub act14(a14 As IRibbonControl)
        Call RndFind(40)
    End Sub
    
    Public Sub act21(a21 As IRibbonControl)
        On Error GoTo Err
        Sheet2.Select
        If Sheet2.Columns("C:C").EntireColumn.Hidden Then
            If MsgBox("Do you want to finish the exam?", 36, "Please confirm") = 6 Then
                Dim ipy As Byte
                Sheet2.Unprotect Password:=""
                Sheet2.Columns("C:C").EntireColumn.Hidden = False
                Sheet2.Columns("B:B").Validation.Delete
                For ipy = 1 To 40
                    If Sheet2.Cells(ipy, 2) <> Sheet2.Cells(ipy, 3) Then
                        Sheet2.Cells(ipy, 2).Interior.Color = 65535
                    Else
                        Sheet2.Cells(ipy, 2).Interior.Pattern = xlNone
                    End If
                Next
                Sheet2.Cells(1, 1).Select
            End If
        Else
            MsgBox "No examinations.", 16, "ERROR"
        End If
        Exit Sub
    Err:
        MsgBox "Unexpect ERROR!", 16, "ERROR"
    End Sub
    
    Public Sub act22(a22 As IRibbonControl)
        MsgBox "Powered By Leisureeen." & vbCrLf & "E-mail:  leisureeen@qq.com", 64, "About The Designer"
    End Sub
    
    Public Sub RndFind(Num)
        Dim rndn%, i As Byte
        On Error GoTo Err
        Sheet2.Select
        If Sheet2.Columns("C:C").EntireColumn.Hidden Then
            MsgBox "Under examination.", 16, "ERROR"
            Exit Sub
        End If
        Sheet2.Cells = ""
        For i = 1 To 40
            Sheet2.Cells(i, 2).Interior.Pattern = xlNone
        Next
        Sheet2.Columns("C:C").EntireColumn.Hidden = True
        Randomize
        For i = 1 To Num
            rndn = Int(Rnd * 559 + 1)
            Sheet2.Cells(i, 1) = Sheet1.Cells(rndn, 1)
            Sheet2.Cells(i, 2).Validation.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="A,B,C,D"
            Sheet2.Cells(i, 3) = Sheet1.Cells(rndn, 2)
        Next
        Sheet2.Columns("B:B").Locked = False
        Sheet2.Protect Password:=""
        Sheet2.Cells(1, 2).Select
        Exit Sub
    Err:
        MsgBox "Unexpect ERROR!", 16, "ERROR"
    End Sub
  • 相关阅读:
    Kibana 地标图可视化
    Filebeat 日志收集
    ELK + Redis 日志收集 & HAProxy
    RAID 磁盘阵列
    Logstash 日志收集(补)
    ELK Stack 介绍 & Logstash 日志收集
    ElasticSearch 集群 & 数据备份 & 优化
    ElasticSearch 交互使用
    网络通信体系
    面向对象思想
  • 原文地址:https://www.cnblogs.com/leisureeen/p/12705112.html
Copyright © 2011-2022 走看看