B4J Question [SOLVED] How to change order of views at runtime?

moore_it

Well-Known Member
Licensed User
Longtime User
Hi all,

i've five panes in mainform, when click on a pane this should become the last in views order.
It's possible to do that at runtime ?

Thanks in advice.
 

William Lancee

Well-Known Member
Licensed User
Longtime User
You can remove the node from MainForm.RootPane and then add it again. It will be the last one.

p.RemoveNodeFromParent
MainForm.RootPane.AddNode(p, ...)

Unless you mean reordering the position on the screen. Then you have to loop through the views and change their position.
You can use MainForm.RootPane.GetAllViewsRecursive
 
Upvote 0

moore_it

Well-Known Member
Licensed User
Longtime User
Thanks for help work perfect.

B4X:
Private Sub pane_MousePressed (EventData As MouseEvent)
    Dim view As B4XView = Sender
    view.BringToFront   
End Sub
 
Upvote 0
Top