Reputation: 19365
I'm currently stuck at creating a layout for a WinForms Control:
My usercontrol hosts the following subcontrols:
RichTextBox
Label B
Control B
Control B
Control B
Label C
Control C
Control C
Label D
Control D
Control D
The RichTextBox is always visible. It's height should grow as big as it needs to be to display all text without ScrollBars.
Depending on my dataobject, I want to display several additional information if present. For instance, there can be 5 controls B, 0 C and 20 D.
I want the controls to "float" to the top. Each control should be able to grow in height in order to display it's full content.
I've tried numerous combinations of TableLayoutPanels, FlowLayoutPanels, docking and autosize settings, but none of them fulfilled my expectations.
How can I arrange my controls in the order I posted above with the features dock top and autosize?
Upvotes: 2
Views: 1422
Reputation: 236268
SizeType = AutoSize
for rows.SizeType = AutoSize
for all rows. Set AutoSize = true
for inner TableLayoutPanel. Place it to next row.ColumnSpan = 2
for lable.B
and C
Upvotes: 4