I have made a window in which I will be having two groups/panels and some buttons in between them. I want to code the resizing behavior in a way that when the window expands
Use the TableLayoutPanel control.
First add the TableLayout to the Form and set its Dock() property to Fill. Next you'll need to setup 3 columns and two rows. Add the two buttons to the middle column with each one is in its own row. Afterwards, setup the column values so they are like this: Leave the rows at 50% on both. Now add your two GroupBoxes to the 1st and 3rd columns in the 1st row. For both GroupBoxes, set Dock() to Fill, and RowSpan() to 2. For the top Button, turn on only the Bottom Anchor. For the bottom Button, turn only the Top Anchor. For the TableLayoutPanel, set Padding() to 5,5,5,5.
Here is what it looked like when I was all done:
Resize the window and observe how the controls behave...