private void searchToolStripMenuItem_Click(object sender, EventArgs e) { var dgv = contextMenu.SourceControl as DataGridView ?? dgvCurrent; if (frmSearch == null || frmSearch.IsDisposed) { frmSearch = new FrmSearch { SearchSource = dgv }; frmSearch.SearchRequested += new EventHandler <SearchEventArgs>(frmFind_SearchRequested); } frmSearch.Show(); frmSearch.Focus(); }
private void searchToolStripMenuItem_Click(object sender, EventArgs e) { var dgv = contextMenu.SourceControl as DataGridView ?? dgvCurrent; if (frmSearch == null || frmSearch.IsDisposed) { frmSearch = new FrmSearch { SearchSource = dgv }; frmSearch.SearchRequested += new EventHandler<SearchEventArgs>(frmFind_SearchRequested); } frmSearch.Show(); frmSearch.Focus(); }