examonline.cs

来自「一个简单的考生答题系统」· CS 代码 · 共 54 行

CS
54
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;

namespace Myschool
{
    public partial class ExamOnline : Form
    {
        public static string sub = "";//保存选中的科目编号
        public ExamOnline()
        {
            InitializeComponent();
        }

        private void btngiveup_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void ExamOnline_Load(object sender, EventArgs e)
        {
           AddSubject.Additem(comsub);//填充下拉列表
        }

        private void btnstart_Click(object sender, EventArgs e)
        {
            if ("" ==Convert.ToString(comsub.SelectedItem))
            {//判断是否选中了科目
                MessageBox.Show("请选择科目!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }     
           sub =Convert.ToString(comsub.SelectedItem);
           ChangshengRandom.SetselectedQuestionIds(sub);//调用产生随机数
           //把每个题目的正确答案读取出来
           Myschool.Select.SelectAnswer();
           //产生一个新窗体
            this.Close();
            StartAnswer sa = new StartAnswer();
            StartAnswer.s = 1;
            StartAnswer.i = 59;
            StartAnswer.j = 19;
            sa.MdiParent = MainForm.ActiveForm;
            sa.Show();
            
        }

        
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?