Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c# winforms evenly distribute 3 controls

Tags:

c#

winforms

i have 3 custom controls, that i want to place in a resizable window next to each other. when the window is being resized, these controls should also resize, each taking 33% of the available width.

i tried to use a table layout, but it seems the table only grows, but never shrinks.

thanks for any help on this!

like image 875
clamp Avatar asked Jun 22 '09 09:06

clamp


1 Answers

You can use a TableLayoutPanel, with 3 columns each of size "33% percent". Then you put each of your control in the panel, and set the anchor property as you wish (for example right-left if your control should resize themselves only on the horizontal plane).

Your TableLayoutPanel should also have its property Dock set to True so that he can occupy all your window and resize accordingly.

like image 156
Ksempac Avatar answered Sep 24 '22 21:09

Ksempac