GroupBox with AutoSize cuts off part of its content
I have a groupBox on my form with AutoSize=true and Dock=Top. It contains a tableLayoutPanel which also has AutoSize=true and Dock=Top. When the label on the top of tableLayoutPanel takes only one line of text everything is ok:
But when it takes more then one line, it cuts off a part of its content:
If I'm changing the height of the grou开发者_开发百科pBox on tableLayoutPanel.Resize event then I have a bug with scrollbar:
It happens when scrollbar becomes visible and changes the size of my label so it takes more lines of text. Can anyone suggest me how to handle this problem?
On tableLayoutPanel.Resize event I'm changing groupBox.Height and leave some free space at the bottom to include possible difference in height. The solution is not perfect but at least it allows to avoid those bugs.
精彩评论