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

北战南征 提交于 2020-01-03 07:19:22

问题


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;

回答1:


Did you try this

int vertScrollWidth = SystemInformation.VerticalScrollBarWidth;

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


来源:https://stackoverflow.com/questions/13320985/still-not-able-to-hide-horizontal-scrollbar-of-flowlayoutpanel-in-winforms-apps

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