I am manually resizing a GroupBox based on its content.
To give it the proper size, it needs to be Content.Size + Border.Size
.
How do I figure out what the size of the GroupBox border is?
I am manually resizing a GroupBox based on its content.
To give it the proper size, it needs to be Content.Size + Border.Size
.
How do I figure out what the size of the GroupBox border is?
You can use the DisplayRectangle
property as a base for the calculations:
var bounds = groupBox.Bounds;
var displayRect = groupBox.DisplayRectangle;
var borderSize = new Size(bounds.Width - displayRect.Width, bounds.Height - displayRect.Height);