Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable horizontal scrollbar for table panel in winforms

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?

like image 294
Nagu Avatar asked Feb 04 '10 05:02

Nagu


People also ask

How do I stop table horizontal scrolling?

To hide the horizontal scrollbar and prevent horizontal scrolling, use overflow-x: hidden: HTML.

How do I remove horizontal scrollbar from table in ABAP?

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.

Why does horizontal scrollbar appear?

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.

How do I turn off horizontal scrolling in Visual Studio?

Use Ctrl + E, then Ctrl + W for disable horizontal scrolling.


1 Answers

int vertScrollWidth = SystemInformation.VerticalScrollBarWidth;

tableLayoutPanel1.Padding = new Padding(0, 0, vertScrollWidth, 0);
like image 64
Pinaskee Avatar answered Sep 28 '22 01:09

Pinaskee