Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
9364
Autosizing of stacked GroupBoxes
posted

I have three GroupBoxes stacked on each other in a Usercontrol.

One docked top, another bottom and last one docked to fill using the Control's dock property.

I am having a hard time getting the autohide behavior from happening. When I collapse the top groupbox control, for example, I was expecting the middle one (which has fill dockstyle) to move up and occupy the space. Instead. I find the top  groupbox control collapses leaving an empty background while the middle one stays put.

What am I doing incorrect that is keeping the autosize from happening ? Is there something on the GroupBox I need to do?Or is there something on the UserControl that I am not setting?

Thanks!

 

PS: I was talking to one of my colleagues and he said I need to change the height of the groupbox control everytime the user expands/collapses it. This he believes would make the other controls to autosize accordingly. 

Parents
  • 19380
    posted

    There are 2 ways you can go about this:

    1) Use the UltraExplorerBar control, add 3 groups, and set the Group -> Settings -> Style to ControlContainer.  Then you can put any type of control in the Group area of the ExplorerBar, and use the automatic re-sizing that the control provides.

    2) Add a TableLayoutPanel to a form with 3 rows and 1 column.  Add a UltraExpandableGroupBox to each section of the Column.  In the Smart Tab for the TableLayoutPanel, click Edit Rows and Column - and select Rows from the Show dropdown.  Set each SizeType to AutoSize.  This will create the behavior you are after.

    Let me know if this helps,

    Thanks

    Jason

     

Reply Children