📄 frmsubjectname.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace 课程安排
{
public partial class frmSubjectName : Form
{
private string subjectName = "";
public string SubjectName
{
get { return subjectName; }
}
private EditLevel editLevel = EditLevel.NULL;
public EditLevel EditLevel
{
get { return editLevel; }
}
public frmSubjectName()
{
InitializeComponent();
this.comboBox1.Enabled = true;
LoadCombo();
}
public frmSubjectName(string oldName)
{
InitializeComponent();
this.comboBox1.Enabled = false;
this.textBox1.Text = oldName;
}
private void LoadCombo()
{
this.comboBox1.Items.Add(Utility.GetEditLevelString(EditLevel.小学));
this.comboBox1.Items.Add(Utility.GetEditLevelString(EditLevel.初中));
this.comboBox1.Items.Add(Utility.GetEditLevelString(EditLevel.高中));
this.comboBox1.SelectedIndex = 0;
}
private void button1_Click(object sender, EventArgs e)
{
this.subjectName = this.textBox1.Text;
if (comboBox1.Enabled)
{
if (!Utility.CheckComboText(this.comboBox1))
{
MessageBox.Show("请从列表框中选择科目级别?", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
else
{
this.editLevel = Utility.GetEditLevelObject(this.comboBox1.Text);
}
}
this.DialogResult = DialogResult.Yes;
this.Close();
}
private void button2_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.No;
this.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -