protected override void OnLayout(LayoutEventArgs levent) { if (this.AutoSize) { AutoSizePanel.ApplyPreferredSize(this); } base.OnLayout(levent); if (this.AutoSize) { AutoSizePanel.ApplyPreferredSize(this); } if (this.AutoScroll) { base.AdjustFormScrollbars(this.AutoScroll); } }