Expanding and Collapsing Navigation Panes
When a Navigation Pane View is applied to the NavBar control, the entire control can be collapsed, and then expanded to restore its size. Refer to the Collapsed Navigation Pane help topic to learn more about the collapsed state.
Expanded State | Collapsed State |
---|---|
In code, the expanded state can be changed via the control’s OptionsBehavior.NavigationPane.Collapsed property. End-users can accomplish this by clicking a double arrow displayed in the Navigation Pane’s header section, if the OptionsBehavior.NavigationPane.Collapsible property is enabled.
You can respond to changes made to the Navigation Pane’s expanded state by handling the OnNavigationPaneCollapsed and OnNavigationPaneExpanded events. The example code below demonstrates how to handle these events to modify the overflow panel‘s visibility, and activate a certain group based on the Navigation Pane’s expanded state.
procedure TForm1.nbMainNavigationPaneCollapsed(Sender: TObject);
begin
nbMain.OptionsView.NavigationPane.ShowOverflowPanel := False;
nbMain.ActiveGroup := bgContacts;
end;
procedure TForm1.nbMainNavigationPaneExpanded(Sender: TObject);
begin
nbMain.OptionsView.NavigationPane.ShowOverflowPanel := True;
nbMain.ActiveGroup := bgMail;
end;