' initialize the ToolBar buttons of page 2
Private Sub InitButtonsPage2
' we want an button 'Edit' on the left
' and a button 'Pages' in the middle of the screen
' dim and initialize the ToolBarButton list
Dim lstToolBarButtons As List
lstToolBarButtons.Initialize
' dim the Edit BarButton
Dim btn As BarButton
' initialize the Edit button as a 'text button'
btn.InitializeText("Edit", "Edit")
' add the button to the list
lstToolBarButtons.Add(btn)
' dim an ITEM_FLEXIBLESPACE button to move the
' Pages button to the middle of the screen
Dim btn As BarButton
btn.InitializeSystem(btn.ITEM_FLEXIBLE_SPACE, "")
lstToolBarButtons.Add(btn)
' dim, initialize and add the Pages BarButton
Dim btn As BarButton
btn.InitializeText("Pages", "Pages")
lstToolBarButtons.Add(btn)
' dim an ITEM_FLEXIBLESPACE button to keep the
' Pages button in the middle of the screen
Dim btn As BarButton
btn.InitializeSystem(btn.ITEM_FLEXIBLE_SPACE, "")
lstToolBarButtons.Add(btn)
Page2.ToolbarButtons = lstToolBarButtons
End Sub