Alex Voskresenskiy
Alex Voskresenskiy

Reputation: 2233

How to configure winforms controls so they don't overlap each other

I have made a user control, which contains 7 controls(labels, dateTimePickers and Combobox), which are placed in a row. It looks like this:enter image description here

Now i need to resize my usercontrol and i wanted to specify minimum width for each element(child control) and i also configured anchors, but when i resize the form, controls overlap each other. How can i configure this properly, or, maybe, i need to use some container for this?

I'll be gratefull for any help!

Upvotes: 0

Views: 2025

Answers (2)

Angelo
Angelo

Reputation: 335

try to use split container then dock your controls inside the split container

Upvotes: 0

Grant Winney
Grant Winney

Reputation: 66439

I'd place them all inside one of the WinForms layout containers, such as the TableLayoutPanel or FlowLayoutPanel (tutorials here and here).

You'll have to play around to see if they'll work for your situation, but they generally take care of keeping controls separated and prevent unintended overlapping.

Upvotes: 1

Related Questions