My application uses a TableLayoutPanel that resides within a TabPage.
If the number of items I add is relatively small (i.e. it doesn't "fill up" the whole tab page) then the last row's height is stretched. Here is a screenshot of what's happening:
I have tried to change the properties of the table to Autosize, GrowAndShrink, etc. but nothing seems to stop this from happening.
Here are my current settings for the layout properties of the table:
How can I get the last row to be the same size as the other rows?
Thanks
Using the dock property solves the last row height problem, but creates another by changing the table width to match the container width (100%). I wanted the height in the last row to be correct but I do not want the forced 100% width.
Instead of using the Dock property, I used:
AutoSizeMode = AutoSizeMode.GrowAndShrink
That made the autosize work correctly on the last row and column.
I just had very similar problem. Filling TableLayoutPanel
programatically (with autoscroll) and the last row was too high. Dock work-around was not suitable for me.
Fixed by adding empty Label
as the last row. It "occupies" the last row, but is not visible. Enough for me.
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