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?
Asked
Active
Viewed 3.2k times
24
3 Answers
65
- 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.

user664939
- 1,977
- 2
- 20
- 35
-
2Thanks for this! Just now I play with it and I find if I set flowDirection=leftToRight, flowlayoutPanel.HorizontalScroll.Visible = false, wrapContents = true. It works...So there is multiple way to do this? Thank you anyway! :) – spspli Apr 05 '11 at 18:36
-
1I have noticed that enabling WrapContents (with LeftToRight flow) will create "line feeds" and thus never needing any horizontal scroll bar. actually I dont like that, I want a WrapContents to false, but I still want FlowBreak property to work, to control manually the line feeds. However this doesn't work. FlowBreak property is ignored, by a sheer bug of that control, if WrapContents is false. booh microsoft. yet again. – v.oddou Mar 28 '13 at 07:58
-
1I am using WrapContents. To achieve the result I want, I have enclosed my FlowLayoutPanel in a Panel control, then I set the Panel's AutoScroll to true, the FlowLayoutPanel's autoscroll to false, and it works! – Larry Apr 02 '14 at 14:27
5
Set AutoScroll to true. Set WrapContents to false. Set Padding Right to 10.
It's work pretty fine for me.

user2559770
- 51
- 1
- 2
-
I thought "no way, it can't work", but yeah, the padding right made trick :S – Cesar Nov 23 '16 at 19:05
-
This trick worked. Only thing is, based on child control's font size you will have to adjust padding. – Prem Aug 16 '19 at 06:16
-
how about disabling the verticalscrollbar instead of the horizontalscrollbar needed? @user2559770 ? – gumuruh Jan 13 '21 at 06:14
-1
Here is how I implement to have multiple labels on a FlowLayoutPanel with wrap text(WrapContents = true), verticalscrollbar only.
- I have a flowLayoutPanel1 on a form
- Set properties of form and flowLayoutPanel1 like below:
form:
AutoScroll = True
FormBorderStyle = Sizable(default)
flowLayoutPanel1:
Anchor = Top, Left, Right
AutoSize = True
FlowDirection = TopDown
WrapContents = true
- Implement this code on form class for testing
int coorY = 0;
public Form2()
{
InitializeComponent();
for (int i = 0; i < 100; i++)
{
flowLayoutPanel1.Controls.Add(new Label
{
Location = new Point(0, coorY + 20),
Font = new Font("Segoe UI", 10f),
Text = "I have a FlowLayoutPanel and there are multiple controls on it. I only want to scroll in vertical",
Width = flowLayoutPanel1.Width,
AutoSize = true
});
coorY += 20;
}
}

Pijazz
- 1
- 1