void SyncWindows() { if (Control != null) { if (AutoScrollPosition.Y != Control.Top || AutoScrollPosition.X != Control.Left) { Control.Left = AutoScrollPosition.X; Control.Top = AutoScrollPosition.Y; WindowlessInvalidate(); } } foreach (Control control in Controls) { IWindowlessControl wc = control as IWindowlessControl; if (wc == null) { continue; } Point p = WindowlessControlHost.WindowlessPointToHost(wc, Point.Empty); if (control.Left != p.X) { control.Left = p.X; } if (control.Top != p.Y) { control.Top = p.Y; } } if (myAutoScroll) { if (Control.Width <= ClientSize.Width && Control.Height <= ClientSize.Height) { if (base.AutoScroll) { base.AutoScroll = false; } } else { if (!base.AutoScroll) { base.AutoScroll = true; } } } // note: this code causes infinite loop // note: this code no longer seems necessary, no wierd scrollbars as of late... // see if we got scroll bars // fix a bug with windows being horrible at making scrollbars disappear. //if (AutoScroll) //{ // SuspendRemeasure(); // foreach (Control control in Controls) // { // if (control.Bottom > ClientSize.Height || control.Right > ClientSize.Width || control.Left < 0 || control.Top < 0 && control.Visible) // { // control.Visible = false; // control.Visible = true; // break; // } // } // ResumeRemeasure(); //} }