📄 frmexam.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;
namespace OES
{
/// <summary>
/// Summary description for frmExam.
/// </summary>
public class frmExam : System.Windows.Forms.Form
{
private System.Windows.Forms.Label lblCreateExam;
private System.Windows.Forms.GroupBox grpPersonalDetails;
private System.Windows.Forms.Label lblExamCode;
private System.Windows.Forms.Label lblSubject;
private System.Windows.Forms.Label lblNumberOfQuestion;
private System.Windows.Forms.Label lblScheduledAt;
private System.Windows.Forms.Label lblDuration;
private System.Windows.Forms.Label lblScheduledOn;
public System.Windows.Forms.ComboBox cboSubject;
private System.Windows.Forms.TextBox txtExamCode;
private System.Windows.Forms.TextBox txtExamTitle;
private System.Windows.Forms.Label lblExamTitle;
private System.Windows.Forms.Label lblMarksperQuestion;
//public System.Windows.Forms.ComboBox cboExamCode;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.DateTimePicker dtpSchedule;
private System.Windows.Forms.Label lblMarks;
private System.Windows.Forms.Button btnHelp;
public System.Windows.Forms.ComboBox cboNumofQuestions;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtScheduledAt;
private System.Windows.Forms.TextBox txtDuration;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
private System.Windows.Forms.ErrorProvider errExam;
private static DataTable dtExam;
//private string errorMsg;
public frmExam()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//populate combo box for subject code
cboSubject.Items.Add("Java");
cboSubject.Items.Add("C#");
cboSubject.Items.Add("SQL Server");
cboSubject.Items.Add("Html");
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmExam));
this.lblCreateExam = new System.Windows.Forms.Label();
this.lblExamCode = new System.Windows.Forms.Label();
this.lblSubject = new System.Windows.Forms.Label();
this.lblNumberOfQuestion = new System.Windows.Forms.Label();
this.grpPersonalDetails = new System.Windows.Forms.GroupBox();
this.txtDuration = new System.Windows.Forms.TextBox();
this.lblDuration = new System.Windows.Forms.Label();
this.dtpSchedule = new System.Windows.Forms.DateTimePicker();
this.lblScheduledAt = new System.Windows.Forms.Label();
this.lblScheduledOn = new System.Windows.Forms.Label();
this.txtScheduledAt = new System.Windows.Forms.TextBox();
this.cboSubject = new System.Windows.Forms.ComboBox();
this.txtExamCode = new System.Windows.Forms.TextBox();
this.txtExamTitle = new System.Windows.Forms.TextBox();
this.lblExamTitle = new System.Windows.Forms.Label();
this.lblMarksperQuestion = new System.Windows.Forms.Label();
this.btnClose = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.lblMarks = new System.Windows.Forms.Label();
this.btnHelp = new System.Windows.Forms.Button();
this.cboNumofQuestions = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.errExam = new System.Windows.Forms.ErrorProvider();
this.grpPersonalDetails.SuspendLayout();
this.SuspendLayout();
//
// lblCreateExam
//
this.lblCreateExam.AutoSize = true;
this.lblCreateExam.BackColor = System.Drawing.Color.Transparent;
this.lblCreateExam.Font = new System.Drawing.Font("宋体", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.lblCreateExam.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(255)));
this.lblCreateExam.Location = new System.Drawing.Point(134, 17);
this.lblCreateExam.Name = "lblCreateExam";
this.lblCreateExam.Size = new System.Drawing.Size(220, 37);
this.lblCreateExam.TabIndex = 9;
this.lblCreateExam.Text = "创 建 考 试";
//
// lblExamCode
//
this.lblExamCode.AutoSize = true;
this.lblExamCode.BackColor = System.Drawing.Color.Transparent;
this.lblExamCode.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblExamCode.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.lblExamCode.Location = new System.Drawing.Point(136, 160);
this.lblExamCode.Name = "lblExamCode";
this.lblExamCode.Size = new System.Drawing.Size(59, 18);
this.lblExamCode.TabIndex = 10;
this.lblExamCode.Text = "考试代码";
//
// lblSubject
//
this.lblSubject.AutoSize = true;
this.lblSubject.BackColor = System.Drawing.Color.Transparent;
this.lblSubject.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblSubject.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.lblSubject.Location = new System.Drawing.Point(136, 112);
this.lblSubject.Name = "lblSubject";
this.lblSubject.Size = new System.Drawing.Size(32, 18);
this.lblSubject.TabIndex = 38;
this.lblSubject.Text = "科目";
//
// lblNumberOfQuestion
//
this.lblNumberOfQuestion.AutoSize = true;
this.lblNumberOfQuestion.BackColor = System.Drawing.Color.Transparent;
this.lblNumberOfQuestion.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblNumberOfQuestion.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.lblNumberOfQuestion.Location = new System.Drawing.Point(394, 155);
this.lblNumberOfQuestion.Name = "lblNumberOfQuestion";
this.lblNumberOfQuestion.Size = new System.Drawing.Size(59, 18);
this.lblNumberOfQuestion.TabIndex = 34;
this.lblNumberOfQuestion.Text = "试题数目";
//
// grpPersonalDetails
//
this.grpPersonalDetails.BackColor = System.Drawing.Color.Transparent;
this.grpPersonalDetails.Controls.Add(this.txtDuration);
this.grpPersonalDetails.Controls.Add(this.lblDuration);
this.grpPersonalDetails.Controls.Add(this.dtpSchedule);
this.grpPersonalDetails.Controls.Add(this.lblScheduledAt);
this.grpPersonalDetails.Controls.Add(this.lblScheduledOn);
this.grpPersonalDetails.Controls.Add(this.txtScheduledAt);
this.grpPersonalDetails.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.grpPersonalDetails.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.grpPersonalDetails.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.grpPersonalDetails.Location = new System.Drawing.Point(134, 276);
this.grpPersonalDetails.Name = "grpPersonalDetails";
this.grpPersonalDetails.Size = new System.Drawing.Size(509, 112);
this.grpPersonalDetails.TabIndex = 36;
this.grpPersonalDetails.TabStop = false;
this.grpPersonalDetails.Text = "考试安排详细信息";
//
// txtDuration
//
this.txtDuration.BackColor = System.Drawing.SystemColors.Info;
this.txtDuration.Location = new System.Drawing.Point(394, 26);
this.txtDuration.Name = "txtDuration";
this.txtDuration.Size = new System.Drawing.Size(57, 22);
this.txtDuration.TabIndex = 54;
this.txtDuration.Text = "";
//
// lblDuration
//
this.lblDuration.AutoSize = true;
this.lblDuration.BackColor = System.Drawing.Color.Transparent;
this.lblDuration.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblDuration.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.lblDuration.Location = new System.Drawing.Point(317, 26);
this.lblDuration.Name = "lblDuration";
this.lblDuration.Size = new System.Drawing.Size(59, 18);
this.lblDuration.TabIndex = 24;
this.lblDuration.Text = "持续时间";
//
// dtpSchedule
//
this.dtpSchedule.CustomFormat = "dd\'/\'MM\'/\'yyyy";
this.dtpSchedule.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtpSchedule.Location = new System.Drawing.Point(134, 24);
this.dtpSchedule.Name = "dtpSchedule";
this.dtpSchedule.Size = new System.Drawing.Size(106, 22);
this.dtpSchedule.TabIndex = 28;
this.dtpSchedule.ValueChanged += new System.EventHandler(this.dtpSchedule_ValueChanged);
//
// lblScheduledAt
//
this.lblScheduledAt.AutoSize = true;
this.lblScheduledAt.BackColor = System.Drawing.Color.Transparent;
this.lblScheduledAt.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblScheduledAt.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.lblScheduledAt.Location = new System.Drawing.Point(10, 62);
this.lblScheduledAt.Name = "lblScheduledAt";
this.lblScheduledAt.Size = new System.Drawing.Size(59, 18);
this.lblScheduledAt.TabIndex = 26;
this.lblScheduledAt.Text = "预定时间";
//
// lblScheduledOn
//
this.lblScheduledOn.AutoSize = true;
this.lblScheduledOn.BackColor = System.Drawing.Color.Transparent;
this.lblScheduledOn.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblScheduledOn.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.lblScheduledOn.Location = new System.Drawing.Point(10, 26);
this.lblScheduledOn.Name = "lblScheduledOn";
this.lblScheduledOn.Size = new System.Drawing.Size(59, 18);
this.lblScheduledOn.TabIndex = 22;
this.lblScheduledOn.Text = "预定日期";
//
// txtScheduledAt
//
this.txtScheduledAt.BackColor = System.Drawing.SystemColors.Info;
this.txtScheduledAt.Font = new System.Drawing.Font("Times New Roman", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.txtScheduledAt.Location = new System.Drawing.Point(134, 62);
this.txtScheduledAt.Name = "txtScheduledAt";
this.txtScheduledAt.Size = new System.Drawing.Size(106, 20);
this.txtScheduledAt.TabIndex = 53;
this.txtScheduledAt.Text = "";
//
// cboSubject
//
this.cboSubject.BackColor = System.Drawing.SystemColors.Info;
this.cboSubject.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboSubject.Location = new System.Drawing.Point(232, 112);
this.cboSubject.Name = "cboSubject";
this.cboSubject.Size = new System.Drawing.Size(135, 20);
this.cboSubject.TabIndex = 37;
this.cboSubject.SelectedIndexChanged += new System.EventHandler(this.cboSubject_SelectedIndexChanged);
//
// txtExamCode
//
this.txtExamCode.BackColor = System.Drawing.SystemColors.Info;
this.txtExamCode.Font = new System.Drawing.Font("Times New Roman", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.txtExamCode.Location = new System.Drawing.Point(232, 160);
this.txtExamCode.Name = "txtExamCode";
this.txtExamCode.ReadOnly = true;
this.txtExamCode.Size = new System.Drawing.Size(135, 20);
this.txtExamCode.TabIndex = 39;
this.txtExamCode.Text = "";
//
// txtExamTitle
//
this.txtExamTitle.BackColor = System.Drawing.SystemColors.Info;
this.txtExamTitle.Font = new System.Drawing.Font("Times New Roman", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.txtExamTitle.Location = new System.Drawing.Point(557, 112);
this.txtExamTitle.Name = "txtExamTitle";
this.txtExamTitle.Size = new System.Drawing.Size(134, 20);
this.txtExamTitle.TabIndex = 41;
this.txtExamTitle.Text = "";
//
// lblExamTitle
//
this.lblExamTitle.AutoSize = true;
this.lblExamTitle.BackColor = System.Drawing.Color.Transparent;
this.lblExamTitle.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblExamTitle.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.lblExamTitle.Location = new System.Drawing.Point(394, 112);
this.lblExamTitle.Name = "lblExamTitle";
this.lblExamTitle.Size = new System.Drawing.Size(59, 18);
this.lblExamTitle.TabIndex = 40;
this.lblExamTitle.Text = "考试标题";
//
// lblMarksperQuestion
//
this.lblMarksperQuestion.AutoSize = true;
this.lblMarksperQuestion.BackColor = System.Drawing.Color.Transparent;
this.lblMarksperQuestion.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblMarksperQuestion.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.lblMarksperQuestion.Location = new System.Drawing.Point(134, 190);
this.lblMarksperQuestion.Name = "lblMarksperQuestion";
this.lblMarksperQuestion.Size = new System.Drawing.Size(86, 18);
this.lblMarksperQuestion.TabIndex = 42;
this.lblMarksperQuestion.Text = "每道题的分数";
//
// btnClose
//
this.btnClose.BackColor = System.Drawing.Color.Transparent;
this.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnClose.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnClose.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.btnClose.Location = new System.Drawing.Point(490, 422);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(96, 26);
this.btnClose.TabIndex = 47;
this.btnClose.Text = "关闭(&O)";
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -