private void toolStripMenuItem3_Select_Click(object sender, EventArgs e) { try { int rowSel = -1; int[] selectedRows = gridView3.GetSelectedRows(); foreach (int r in selectedRows) { rowSel = r; } if (formXemDuAn == null) { formXemDuAn = new F_XemDuAn(table_DSDuAn.Rows[rowSel].ItemArray[6].ToString()); formXemDuAn.FormClosed += new FormClosedEventHandler(formXemDuAn_FormClosed); formXemDuAn.Show(); } else { formXemDuAn.Activate(); } } catch { } }
void formXemDuAn_FormClosed(object sender, FormClosedEventArgs e) { formXemDuAn = null; }