Just use two Panel controls, both with Dock = Top. Then it just takes two lines of code to switch between the expanded and collapsed view:
panel1.Visible = !panel1.Visible;
this.ClientSize = new Size(this.ClientSize.Width, panel2.Bottom);
Вопрос
Here is a sample form I want to minimize.
This is the original size of the form:
When it is minimized it should hide other parts of the form and only display a specific area and should look like this:
I should be able to return back the form to its original state and vice versa. Is this possible? I have only tried minimizing a form to the taskbar but I have not tried this approach and I wanted to know if this can be possible because I find this feature very handy.
Решение
Just use two Panel controls, both with Dock = Top. Then it just takes two lines of code to switch between the expanded and collapsed view:
panel1.Visible = !panel1.Visible;
this.ClientSize = new Size(this.ClientSize.Width, panel2.Bottom);