如何在flowLayoutPanel中禁用Horizo​​ntalScroll?

时间:2015-09-24 11:19:14

标签: c# .net

flowLayoutPanel1.AutoScroll = true;
flowLayoutPanel1.VerticalScroll.Enabled = true;
flowLayoutPanel1.HorizontalScroll.Enabled = false;
flowLayoutPanel1.HorizontalScroll.Visible = false;

以上代码无效。如何禁用Horizo​​ntalScroll?

1 个答案:

答案 0 :(得分:0)

您是否尝试过this

int vertScrollWidth = SystemInformation.VerticalScrollBarWidth;

flowlayoutPanel1.Padding = new Padding(0, 0, vertScrollWidth, 0);

或设置

flowDirection=leftToRight
flowlayoutPanel.HorizontalScroll.Visible = false
wrapContents = true