How do I keep my winforms controls from overlapping when I expand the application?

Jason picture Jason · Jan 3, 2013 · Viewed 16.6k times · Source

I have a pretty simple winforms application. It contains a rich edit box, embedded browser, progress bar, a few buttons etc.

I have the anchors on the controls set to expand in all directions.

When expanding up and down, however, the controls will overlap one another. How do I prevent this from happening?

Thanks

Answer

Trevor Pilley picture Trevor Pilley · Jan 3, 2013

Your best bet is to add a TableLayoutPanel to your form which contains the "layout grid" this should be docked to the form, then you can add your controls into the cells in the table (they can cover multiple rows and columns so you can get the layout you want).