Hide horizontal scrollbar in tablelayoutpanel
When populating a tablelayoutpanel dynamically, the horizontal scrollbar kept appearing, even though there was no need for it.
It looks like there is no property to disable only the horizontal scrollbar, but I did find this workaround.
Pad the layoutpanel to the width of the horizontal scroll bar and the scroll bar will disappear.
int vertScrollWidth = SystemInformation.VerticalScrollBarWidth;
tableLayoutPanel1.Padding = new Padding(0, 0, vertScrollWidth, 0);
Trackback URI |