private void btnAdd_Click(object sender, EventArgs e) { if (flag && dgvUsers.SelectedRows.Count == 1) { flag = false; if (add == null || add.IsDisposed) { add = new AddEmployee(this); add.MdiParent = this.MdiParent; } add.Show(); } }