Aaron Deming
Aaron Deming

Reputation: 1045

Windows Forms Resizing And Overlapping UserControls

I have a Windows Form with 9 identical user controls that are directly adjacent to one another. On my screen the form looks fine, but when running a coworkers machine, the window gets resized and the user controls overlap. Does anyone know how i can prevent them from overlapping? I don't mind that the window is resizing on different machines, I just don't want any lost information or partially hidden elements.

Thank you in advance.

Upvotes: 0

Views: 2870

Answers (1)

Grant Winney
Grant Winney

Reputation: 66439

You could use a FlowLayoutPanel. It won't work in every situation, depending on what kind of controls you intend to place inside it. I'm not sure what your user control look like, but I just added a FlowLayoutPanel and added about a dozen buttons inside it, and it takes care of adjusting the layout for me when the end-user resizes the form, maintaining padding around each button and avoiding overlapping.

If your user controls can flow around each other, and it doesn't matter if they are side by side or one over the other, you may want to check this out.

Upvotes: 1

Related Questions