Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one make a child panel fill the remaining space in a parent panel?

Tags:

c#

winforms

I've got two panels (panel1 and panel2) inside a main panel. Panel1 is set to DockStyle.Top and panel2 is set to DockStyle.Fill. I would assume that panel2 would fill the remaining space left after panel1 but instead it just fills the whole of the main panel and panel1 sits over panel2.

How do I get panel2 to just fill the remaining space after panel1 is set to DockStyle.Top without them overlapping?

like image 490
scheepersw Avatar asked Dec 27 '22 15:12

scheepersw


1 Answers

For the Panel2 use anchors in all ways.

like image 105
Samich Avatar answered Jan 30 '23 03:01

Samich