public void Dispose() { DisposeToolstripControlHost(); if (_PopupControlHost != null) { _PopupControlHost.Closed -= new ToolStripDropDownClosedEventHandler(DropDownClosed); _PopupControlHost.Closing -= new ToolStripDropDownClosingEventHandler(DropDownClosing); _PopupControlHost.Dispose(); _PopupControlHost = null; } }
private void InitializePopupControlHost() { if (_PopupControlHost == null) { _PopupControlHost = new PopupControlHost(); _PopupControlHost.Closed += new ToolStripDropDownClosedEventHandler(DropDownClosed); _PopupControlHost.Closing += new ToolStripDropDownClosingEventHandler(DropDownClosing); } }