Desktop Page Panel

From Xojo Documentation

The Page Panel is an invisible control that allows you to group controls into multiple panels (or pages). Only the controls on the current panel are visible. This control has no tabs or other navigation widgets, nor does it have a visible border. Only the controls on each panel are visible. You are responsible for providing the method of navigating from one panel to another, which you do by changing the SelectedPanelIndex property programmatically.

In the Layout Editor, you navigate among panels in a Page Panel control using the widget at the bottom of the control. There are two ways to navigate between existing panels. Click in the center of the navigation widget to get access the “Go to Page” command that shows a drop-down menu of page numbers. Select a page number from this menu to go directly to the panel on that page. Or, click the left or right arrows to the left or right of the page number in the widget to go to the next or previous panel.

Page Panel Library Icon

You add, remove, and reorder panels using the Panel Editor. You can display the Panel editor by clicking the Edit button next to the Panels property in the Inspector of a Page Panel. In addition to using the Up/Down buttons to reorder the panels, you can also drag them into the order you want.

Below is a list of commonly used events, properties and methods. Refer to PagePanel in the Language Reference for details on all its events, properties and methods.

A Page Panel with a Container Control within it


Change - The PanelChanged event handler is called when the SelectedPanelIndex property changes.


PanelCount - Returns the number of panels.

SelectedPanelIndex - Used to get or set the currently displayed panel.


AddPanel, AddPanelAt, RemovePanelAt - These methods are used to add or remove panels. Controls that are added to a Page Panel are referenced in your code by just using the control name as if it were not in a Page Panel.


Since controls added to a Page Panel are referenced by the control's name you can change the Caption on a button on a PagePanel like this:

PushButton1.Caption = "OK"

To change the panel, which then shows only the controls on the specific panel use the Value property:

MyPanel.SelectedPanelIndex = 2

See Also

PagePanel class; UserGuide:Desktop Tab Panel, UserGuide:Desktop Container Control topics