Captain
Captain

Reputation: 123

How to disable HorizontalScroll in flowLayoutPanel?

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

The above code is not working. How to disable HorizontalScroll ?

Upvotes: 0

Views: 812

Answers (1)

Litisqe Kumar
Litisqe Kumar

Reputation: 2564

Did you try this

int vertScrollWidth = SystemInformation.VerticalScrollBarWidth;

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

Or set

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

Upvotes: 2

Related Questions