private void _formFind_OnFormClose(object sender, EventArgs e) { if (_formFind == null) { return; } _formFind.OnSearch -= _formFind_OnSearch; _formFind.OnFormClose -= _formFind_OnFormClose; _formFind = null; _tabSearchEngine = null; }
private void findToolStripMenuItem_Click(object sender, EventArgs e) { // Set Tab page object reference to the search Service if (_formFind != null && !_formFind.IsDisposed) { _formFind.Show(); _formFind.Location = GetCenterLocationForChildForm(_formFind); _formFind.Activate(); return; } _formFind = new FormFind(); _formFind.OnSearch += _formFind_OnSearch; _formFind.OnFormClose += _formFind_OnFormClose; _formFind.Show(this); _formFind.Location = GetCenterLocationForChildForm(_formFind); }