📄 studentform.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace MySchool
{
/// <summary>
/// 教员登录后的主窗体
/// </summary>
public partial class StudentForm : Form
{
public StudentForm()
{
InitializeComponent();
}
// 单击“退出”菜单项时,退出应用程序
private void tsmiExit_Click(object sender, EventArgs e)
{
// 弹出消息框向用户确认
DialogResult result = MessageBox.Show("确定要退出吗?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question);
// 如果选择了“是”,退出应用程序
if (result == DialogResult.Yes)
{
Application.Exit();
}
}
// 点击菜单中的“帮助”->”关于”,以模式窗口显示 About 窗体
private void tsmiAbout_Click(object sender, EventArgs e)
{
AboutForm aboutForm = new AboutForm();
aboutForm.ShowDialog(); // 以模式窗口显示
}
// 窗体加载事件处理
private void TeacherForm_Load(object sender, EventArgs e)
{
// 设置状态栏标签显示的文字
lblTeacher.Text = string.Format("学员{0}登录了!",UserHelper.loginId);
}
// 进入在线答题模块,显示选题窗体
private void tsmiQuiz_Click(object sender, EventArgs e)
{
SelectQuestionsForm selectQuestionsForm = new SelectQuestionsForm();
selectQuestionsForm.MdiParent = this;
selectQuestionsForm.Show();
}
// 窗体关闭事件
private void StudentForm_FormClosed(object sender, FormClosedEventArgs e)
{
Application.Exit();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -