Use the PanelBar.ExpandMode property to determine the operation of the PanelBar expand/collapse behavior.
In order to make a traditional "Outlook Bar" where only a single group is expanded at a time, but the height of the entire PanelBar is determined by the content of the expanded panel, set:
The PanelBar will now expand one group each time the user clicks on a Group button, while simultaneously collapsing another. The overall height of the PanelBar will adjust to accomodate the height of the expanding Group and all of its Items.