'assuming you have 3 pages, page1,page2 and page3 all defined as Page elsewhere
' Note the pages MUST have been previously initialised
sub process_globals
public page as page
' layout with 3 buttons
' all buttons use the button event
private button1 as button
private button2 as button
private button3 as button
end sub
' this can be the same in page1,page2 & page3
public init
if not(page.isinitialized) then
page.initialize("thispage")
page.loadlayout("3buttons")
page1.init
page2.init
page3.init
button1.tag = page1.page
button2.tag = page2.page
button3.tag = page3.page
end if
' do other stuff
end sub
sub button_click
private btn as button = sender
private displaypage as page = btn.tag
Main.NavControl.ShowPage(displaypage)
'or
Main.NavControl.SetpagesStack(Array(displaypage))
end sub