Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

still Not able to Hide Horizontal Scrollbar of FlowLayoutPanel in WinForms Apps

I am not able to hide the Horizontal Scroll-bar of my FlowLayout panel. I am adding this panel dynamically.

I have read the below 3 posts on stack overflow. but not able to get success.

flowlayoutpanel and horizontal scrollbar issue

How do I disable the horizontal scrollbar in a Panel

Scrolling panel using horizontal scroll bar

I have tried the following code.

TableLayoutPanel pannel = new TableLayoutPanel();
 pannel.Parent = pnlChart;
 pannel.Dock = DockStyle.Fill;
 pannel.AutoScroll = true;
 pannel.HorizontalScroll.Visible = false;
like image 335
Nitin Vijay Avatar asked Nov 10 '12 09:11

Nitin Vijay


1 Answers

Did you try this

int vertScrollWidth = SystemInformation.VerticalScrollBarWidth;

pannel.Padding = new Padding(0, 0, vertScrollWidth, 0);
like image 190
Samy S.Rathore Avatar answered Sep 17 '22 06:09

Samy S.Rathore