dimitris93
dimitris93

Reputation: 4273

Having a certain layout when adding labels to a Panel

I have a WinForm with a Panel and I keep adding Labels to it. Is it possible to set the Panel so that everytime I add a label it will have a certain layout ? The layout I am looking for is having a single column of Labels, so everytime I add a new Label it will be added to the next row. I haven't found any property for the Panel to do that. Is this possible ?

Upvotes: 1

Views: 127

Answers (3)

The Vermilion Wizard
The Vermilion Wizard

Reputation: 5395

Use a TableLayoutPanel and set its ColumnCount to 1.

Upvotes: 0

Yogi
Yogi

Reputation: 9749

Use FlowLayoutPanel instead of Panel. And set the FlowDirection property to TopDown

Upvotes: 3

Artak
Artak

Reputation: 2887

You can create a ListBox in the panel, and then add the Labels to it, rather than to panel directly.

Upvotes: 0

Related Questions