Hi I've a tablelayoutpanel and I'm binding controls to it dynamically. When the item count exceeds the height of panel obviously vertical scroll bar appearing there is no problem.
But the same time horizontal scroll bar is also appearing even the items width is less than the width of panel. How can i prevent this?
To hide the horizontal scrollbar and prevent horizontal scrolling, use overflow-x: hidden: HTML.
Goto Layout of your screen -> Click on the Screen Attributes of your table control -> You will find a field for Fixed Columns at the bottom of the attributes. Set that to the number of fields on your table control.
Web browsers do not take into account the width of the scrollbar on the side of a page when computing width values, so since we have a page that is longer than a single viewport, part of our page is being rendered behind the vertical scroll bar, causing the browser to display a horizontal scroll bar.
Use Ctrl + E, then Ctrl + W for disable horizontal scrolling.
int vertScrollWidth = SystemInformation.VerticalScrollBarWidth;
tableLayoutPanel1.Padding = new Padding(0, 0, vertScrollWidth, 0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With