views:

542

answers:

1

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?

+1  A: 

Is the issue that your items are exactly the width of the the layout panel, so that when the verticle scroll appears it cuts into your controls a bit, forcing the horizontal scroll? If so, you can either make your controls smaller width-wise to account for the possibility of the scrollbar, or you can try to adjust them when the scroll bar appears.

Kevin Stafford