How to disable horizontal scroll bar in FlowLayoutPanel?

∥☆過路亽.° 提交于 2019-11-28 02:35:12

问题


I have a FlowLayoutPanel and there are multiple controls on it. I only want to scroll in vertical direction. But when I set AutoScroll = true, I got both Vertical and Horizontal Scroll bars. How could I disable the horizontal scroll bar and only keep the vertical scroll bar working?


回答1:


  • Set AutoScroll to true
  • Set WrapContents to false.
  • Make sure the size is wider than the controls' width plus the width of a vertical scrollbar.

The horizontal scrollbar should disappear. If it doesn't, please provide some more information.




回答2:


Set AutoScroll to true. Set WrapContents to false. Set Padding Right to 10.

It's work pretty fine for me.



来源:https://stackoverflow.com/questions/5556561/how-to-disable-horizontal-scroll-bar-in-flowlayoutpanel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!