Beispiel #1
0
        private void ScrollWindow(int XOffset, int YOffset)
        {
            int num_of_children;

            if (XOffset == 0 && YOffset == 0)
            {
                return;
            }

            SuspendLayout();

            num_of_children = Controls.Count;

            for (int i = 0; i < num_of_children; i++)
            {
                Controls[i].Location = new Point(Controls[i].Left - XOffset, Controls[i].Top - YOffset);
                //Controls[i].Left -= XOffset;
                //Controls[i].Top -= YOffset;
                // Is this faster? Controls[i].Location -= new Size(XOffset, YOffset);
            }

            scroll_position.X += XOffset;
            scroll_position.Y += YOffset;
            var rect = ClientRectangle;

            rect.Location = new Point(XOffset, YOffset);
            m_helper.ScrollRectToVisible(Util.RectangleToNSRect(rect));
            ResumeLayout(false);
        }
 internal override void UpdateBounds()
 {
     m_helper.SetFrame(Util.RectangleToNSRect(bounds), true);
 }