// private void tsmiAddStudent_Click(object sender, EventArgs e) { CloseForm(); FrmAddStudent objForm = new FrmAddStudent(); OpenForm(objForm); }
/// <summary> /// panel 切换到新增学生 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolStripButton1_Click(object sender, EventArgs e) { closeForm(); FrmAddStudent frmAddStudent = new FrmAddStudent(); openForm(frmAddStudent); }
//显示添加新学员窗体 private void tsmiAddStudent_Click(object sender, EventArgs e) { // FrmAddStudent objForm = new FrmAddStudent(); //判断右侧中容器是否已经存在窗口-嵌入的基本步骤 OpenForm(objForm); }
private void tsbAddStudent_Click(object sender, EventArgs e) { if (objFrmAddStudent == null) { objFrmAddStudent = new FrmAddStudent(); objFrmAddStudent.Show();//show this windows } else { objFrmAddStudent.Activate(); objFrmAddStudent.WindowState = FormWindowState.Normal; } }
//怎样保证对象的唯一性 private void tsmiAddStudent_Click(object sender, EventArgs e) { if (objFrmAddStudent == null) { objFrmAddStudent = new FrmAddStudent(); objFrmAddStudent.Show(); } else { objFrmAddStudent.Activate();//激活只能在最小化的时候起作用 objFrmAddStudent.WindowState = FormWindowState.Normal; } }
//显示添加新学员窗体 private void tsmiAddStudent_Click(object sender, EventArgs e) { CloseForm(); FrmAddStudent objForm = new FrmAddStudent(); this.OpenForm(objForm); }
//显示添加新学员窗体 private void tsmiAddStudent_Click(object sender, EventArgs e) { FrmAddStudent addStudent = new FrmAddStudent(); OpenForm(addStudent); }