Click here to Skip to main content
14,389,512 members
Rate this:
Please Sign up or sign in to vote.
See more:
I have a form with a flowlayoutpanel where I load several usercontrols dynamically. 
 I need when the form|flowlayoutpanel resize the controls change the margin to fill all the flowlayoutpanel.

I have:
--|Control|--|Control|--|Control|------

I need:
---|Control|---|Control|---|Control|---


What I have tried:

I tried change Padding of the controls and dock property of the flowlayoutpanel but not work.
Posted
Updated 9-Oct-19 4:46am
Rate this:
Please Sign up or sign in to vote.

Solution 1

Switch from using a FlowLayoutPanel to a TableLayoutPanel.
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

Use Margin[^] and Padding[^] of control to increase/decrease space between and inside of controls.

For further details, please see: Margin and Padding in Windows Forms Controls | Microsoft Docs[^]
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100