private void barUXConnection_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (uxConnection == null) { uxConnection = new Addons.Base.UXConnection(); uxConnection.Disposed += new EventHandler(uxConnection_Disposed); //Add Disposed EventHandler uxConnection.MdiParent = this; TabMDIUX.MdiParent = this; uxConnection.Show(); uxConnection.Dock = DockStyle.Fill; uxConnection.BringToFront(); } else { uxConnection.Activate(); uxConnection.BringToFront(); } }
void uxConnection_Disposed(object sender, EventArgs e) { uxConnection = null; }