How to disable horizontal scroll bar in FlowLayoutPanel?

spspli picture spspli · Apr 5, 2011 · Viewed 26.4k times · Source

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?

Answer

user664939 picture user664939 · Apr 5, 2011
  • 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.