Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add an expander (collapse/expand) to a Panel WinForm

I have a panel containing a DataGridView and 3 buttons at the bottom of a form. I want to add the possibility to expand and collapse this panel. Is there a way to do it in a Windows Forms application?

Has someone done something similar?

like image 953
aleroot Avatar asked Sep 25 '10 18:09

aleroot


2 Answers

The SplitContainer control has the ability to collapse one of its two panels. You could rig up a button to the Panel1Collapsed property.

like image 79
Bradley Smith Avatar answered Sep 21 '22 20:09

Bradley Smith


Take a look at my WinForm expander control - https://github.com/alexander-makarov/ExpandCollapsePanel

In general, it must meet all the basic requirements for this kind of control.

  • Easy editing in Form Designer
  • Put any control that you want into the content region
  • Apply different styles and sizes

Easy editing in Form Designer

like image 43
Alexander Makarov Avatar answered Sep 18 '22 20:09

Alexander Makarov