I have a form
(600x500 px). In this form
there are 2 groupboxes
. The first one being 260 px and the second one 330 px.
What I would like is that when I resize the form
, those two boxes resize with it, but by keeping the proportions. (the second one bigger then the first).
No matter how I set the Anchor
points, I dont seem to be able to do this.
You can achieve that with a
TableLayoutPanel
like this:TableLayoutPanel
on yourForm
. Set the anchor toLeft
,Top
,right
(andBottom
in needed) or set Dock property toFill
TableLayoutPanel
(by default there is two columns and two rows, so remove the last row)GroupBoxs
to each cellFill
orTop
for eachGroupBox
System.Windows.Forms.SizeType.Percent
, so just adjust the first column with in designer as you need.Result:
Before resizing
After resizing (image is reduced so you can see that it keeps proportion)