Bug? [B4XPages] UTILITY form style breaks returning to MainPage

William Lancee

Well-Known Member
Licensed User
Longtime User
B4X:
Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.SetFormStyle("UTILITY")        'Without this the attached works, but with this when closing the page3, page2, page1, the MainPage disappears.
                                                                    'It is still there but not in focus (minimize IDE to see it)
    MainForm.Show
    Dim PagesManager As B4XPagesManager
    PagesManager.Initialize(MainForm)
End Sub
 

Attachments

  • pageNavProb.zip
    25.2 KB · Views: 229
Last edited:

William Lancee

Well-Known Member
Licensed User
Longtime User
Apparently 1st page cannot be UTILITY. Therefore a SOLUTION:

B4X:
'remove from Main

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
'    MainForm.SetFormStyle("UTILITY")        'remove here'
'    MainForm.Show                            'remove here'
    Dim PagesManager As B4XPagesManager
    PagesManager.Initialize(MainForm)
End Sub

'And add to other page classes, except for 1st (In this example MainPage)

Private Sub B4XPage_Created (Root1 As B4XView)
    B4XPages.GetNativeParent(Me).SetFormStyle("UTILITY")    'add this
    Root = Root1
    'load the layout to Root
End Sub
 
Top