dario_ramos
dario_ramos

Reputation: 7309

Can't get flow layout panel to disappear when empty

I have a custom Windows Forms (a class which extends System.Windows.Forms). Its layout is as follows:

enter image description here

UPDATE: I'm willing to redo the layout in a more convenient way, or even redo the whole form using WPF.

Upvotes: 1

Views: 491

Answers (2)

Pondidum
Pondidum

Reputation: 11617

If you remove FLP_top_down, change flp_left_to_right to be .Dock = DockStyle.Fill and change flp_left_to_right to be .Dock = DockStyle.Bottom, you should get what you are after.

Upvotes: 1

LarsTech
LarsTech

Reputation: 81610

I doesn't look like you need the Top-Down FlowLayoutPanel.

Try taking your Right-Left FlowLayoutPanel and Dock it to the bottom. Then take your Left-Right FlowLayoutPanel and Dock Fill it in the remaining area.

Where your button panel has no visible buttons, then you can just hide the panel and the Filled panel will take up that remaining space.

Upvotes: 1

Related Questions