private void tsmiAddResult_Click(object sender, EventArgs e) { FrmEditStudent fedit = new FrmEditStudent(); fedit.studentNo = -1; fedit.Show(); }
/// <summary> /// 打开编辑学生信息窗体 /// </summary> private void tsmiEdit_Click(object sender, EventArgs e) { if (this.lvResult.SelectedItems.Count > 0) { FrmEditStudent editStudent = new FrmEditStudent(); // 将选中的学号传递到编辑学生信息窗体 editStudent.studentNo = Convert.ToInt32(this.lvResult.SelectedItems[0].Text); editStudent.MdiParent = this.MdiParent; editStudent.Show(); } else { MessageBox.Show("请选择一个学生!", CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Information); } }