开发者

GroupBox with AutoSize cuts off part of its content

开发者 https://www.devze.com 2023-02-20 07:40 出处:网络
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 lin

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:

GroupBox with AutoSize cuts off part of its content

But when it takes more then one line, it cuts off a part of its content:

GroupBox with AutoSize cuts off 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:

GroupBox with AutoSize cuts off part of its content

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消