B4J Question Need to keep second & third form on top

chuck3e

Active Member
Licensed User
Longtime User
I have an app with three forms the first one fills the screen and the next two take up a third each. When I click on the first form it hides the second and third. Is there a way I can force these two to stay on top?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Make sure to set the forms owner:
B4X:
Sub AppStart (Form1 As Form, Args() As String)
   MainForm = Form1
   'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
   MainForm.Show
   Dim frm1, frm2 As Form
   frm1.Initialize("", 300, 300)
   frm2.Initialize("", 300, 300)
   frm1.SetOwner(MainForm)
   frm2.SetOwner(MainForm)
   frm1.Show
   frm2.Show
End Sub
 
Upvote 0

chuck3e

Active Member
Licensed User
Longtime User
Make sure to set the forms owner:
B4X:
Sub AppStart (Form1 As Form, Args() As String)
   MainForm = Form1
   'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
   MainForm.Show
   Dim frm1, frm2 As Form
   frm1.Initialize("", 300, 300)
   frm2.Initialize("", 300, 300)
   frm1.SetOwner(MainForm)
   frm2.SetOwner(MainForm)
   frm1.Show
   frm2.Show
End Sub

Thanks Erel, this works great!
 
Upvote 0
Top