Panel Help

cnicolapc

Active Member
Licensed User
Longtime User
Hi,
Sorry, you could have a practical example of the management of two panels?
panel1 - start screen
panel2 - the program
The panel1 should appear only at the beginning, and then when the active panel2 (and also active screen rotation, the panel1 must remain closed).
I tried but when I rotate the screen is always active panel1
I read the tutorial (activity.Resume - Activity.pause) but an example would help me a lot.
Thanks in advance
Nicola
Sorry for my bad english
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Here:
B4X:
Sub Globals
    Dim Panel1 As Panel
    Dim Panel2 As Panel
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Activity.LoadLayout(...)
    'Here I do not load the panels from a layout file so we need to initialize them.
    Panel1.Initialize("Panel1")
    Panel1.Color = Colors.Red
    Panel2.Initialize("Panel2")
    Panel2.Color = Colors.Blue
    Activity.AddView(Panel1, 0, 0, 100%x, 100%y)
    Activity.AddView(Panel2, 0, 0, 100%x, 100%y)
    If FirstTime Then
        Panel1.BringToFront
    Else
        Panel1.Visible = False
    End If
End Sub
Sub Panel1_Click
    Panel1.Visible = False
    Panel2.BringToFront
End Sub
 
Upvote 0
Top