C# · 12月 25, 2021

c# – 仍然无法隐藏WinForms应用程序中FlowLayoutPanel的水平滚动条

我无法隐藏我的FlowLayout面板的水平滚动条.我正在动态添加该面板.

我已经读过下面3个堆栈溢出的帖子.但不能取得成功.

flowlayoutpanel and horizontal scrollbar issue

How do I disable the horizontal scrollbar in a Panel

Scrolling panel using horizontal scroll bar

我已经尝试了以下代码.

TableLayoutPanel pannel = new TableLayoutPanel(); pannel.Parent = pnlChart; pannel.Dock = DockStyle.Fill; pannel.AutoScroll = true; pannel.HorizontalScroll.Visible = false;解决方法 你尝试过 this int vertScrollWidth = SystemInformation.VerticalScrollBarWidth;pannel.Padding = new Padding(0,vertScrollWidth,0);