private void SidebarUndock_MouseDown(object sender, MouseEventArgs e) { int iTop = this.Top + pnSide.Top; Point ptLoc = new Point(this.Left, iTop); frmSidebar frm = new frmSidebar(pnSide, ptLoc); frmMain_Resize(new object(), new EventArgs()); alUndocked.Add(frm); frm.Show(); }
private void tRedock_Tick(object sender, EventArgs e) { bool bResize = false; for (int a = 0; a < alUndocked.Count; a++) { frmSidebar frm = ((frmSidebar)alUndocked[a]); if (frm.bClosed) { this.Controls.Add(frm.pn); frm.pn.Location = new Point(0, 56); frm.Close(); frm.Dispose(); //This is to AVOID confusion. alUndocked.RemoveAt(a); a--; bResize = true; } } if (bResize) { frmMain_Resize(new object(), new EventArgs()); } }