protected override void OnLayout(LayoutEventArgs e) { if (ParentToolStrip != null && ParentToolStrip.IsInDesignMode) { if (FlowLayout.GetFlowDirection(this) != FlowDirection.TopDown) { FlowLayout.SetFlowDirection(this, FlowDirection.TopDown); } if (FlowLayout.GetWrapContents(this)) { FlowLayout.SetWrapContents(this, false); } } else { if (FlowLayout.GetFlowDirection(this) != FlowDirection.LeftToRight) { FlowLayout.SetFlowDirection(this, FlowDirection.LeftToRight); } if (!FlowLayout.GetWrapContents(this)) { FlowLayout.SetWrapContents(this, true); } } base.OnLayout(e); }
private void InitFlowLayout() { if (this.Orientation == System.Windows.Forms.Orientation.Horizontal) { FlowLayout.SetFlowDirection(this, FlowDirection.TopDown); } else { FlowLayout.SetFlowDirection(this, FlowDirection.LeftToRight); } FlowLayout.SetWrapContents(this, false); }
protected override void OnLayout(LayoutEventArgs e) { if (ParentToolStrip is not null && ParentToolStrip.IsInDesignMode) { if (FlowLayout.GetFlowDirection(this) != FlowDirection.TopDown) { FlowLayout.SetFlowDirection(this, FlowDirection.TopDown); } if (FlowLayout.GetWrapContents(this)) { FlowLayout.SetWrapContents(this, false); } }