I want to design one simple form with Microsoft Visual Studio, I have one DataGridView and one ListView. When I resize the main form, I want the components to resize related to the size of main form and size of each other.
I use the anchor property but it didn’t work as I expected, I want controllers to remain side by side in all situations.
As you can see in the 2 images below, when I maximize the window there is a gap between Datagridview and ListView. How can I fix this?


You need to set the Anchor of your grid to
Now if you want them to have always the same size;
add a
TableLayoutPanelwith 2 columns set to 50%, and add yourlistviewandgridto it. (TheTableLayoutPanelshould be anchored so it expands)