Android Question How to move panel using button?

I try this code to put panel2 on the top of panel1, and it doesn't work can someone help me thanks :>

Private Sub movebtn_Click
Panel2.SetLayoutAnimated(100,Panel1.Left,Panel1.Top,460dip,700dip)
End Sub
 

toby

Well-Known Member
Licensed User
Longtime User
In the Designer, right-click Panel1 and select Duplicate and you will get exactly what you need:
1. A new panel named Panel2, assuming the name is not in use already.
2. Panel2 sits on top of Panel1
3. Both panels have same parent
 
Upvote 0
Please use [code]code here...[/code] tags when posting code.


What happens?

Make sure that Panel2 parent is the same as Panel1 parent.
oh im really sorry, Mr.Erel

the panel1 and panel 2 are already in the same parent. and my goal for panel2 is to move it at panel1 when i click the button at debug mode.
its like it has a sliding animation on it while mivong on the panel 1

Move button:
Private Sub movebtn_Click
    Panel2.SetLayoutAnimated(100,Panel1.Left,Panel1.Top,460dip,700dip)'trying to set panel2 at the top of panel1
End Sub
 
Upvote 0

toby

Well-Known Member
Licensed User
Longtime User
B4X:
Panel2.visible=True 'show panel2 by placing Panel2 over panel1
'or
Panel2.visible=False 'show panel1
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…