public override void SetDimensions(Point size, bool expandChildren = false) { base.SetDimensions(size, expandChildren); frame.SetDimensions(size, expandChildren); if (scrollBar.IsHorizontal) { scrollBar.Rect = new Rectangle(this.rect.X, this.rect.Bottom - 20, this.rect.Width, 20); } else { scrollBar.Rect = new Rectangle(this.rect.Right - 20, this.rect.Y, 20, this.rect.Height); } UpdateScrollBarSize(); }