private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { int a = (int)dataGridView1.Rows[e.RowIndex].Cells[0].Value; //获取选中行指定列 if (wz == 1) //管理部门页面 { bmtj.setVisible(1); //设置为修改页面 bmtj.setId(a); bmtj.BringToFront(); bmtj.Show(); } else if (wz == 2) { glyg.setVisible(1); glyg.setId(a); glyg.BringToFront(); glyg.Show(); } else if (wz == 3) { gzgl.setVisible(1); gzgl.setId(a); gzgl.BringToFront(); gzgl.Show(); } }
private void 添加ToolStripMenuItem_Click(object sender, EventArgs e) { if (bmtj == null) { bmtj = new 管理部门(); bmtj.MdiParent = this; bmtj.setGuanli(this); } bmtj.setVisible(0); //设置为添加页面 bmtj.BringToFront(); bmtj.Show(); }