Sub PanPop( mlayout As String, hc As Int, wc As Int) '( mlayout=your .bal file, hc=height offset + or -, wc=same for width )
pnlSelect2.Initialize ( "Select2")
pnlInput2.Initialize ("")
pnlInput2.LoadLayout ( mlayout )
pnlSelect2.Color = Colors.ARGB (150,0,0,0)
Activity.AddView (pnlSelect2, 0, 0, 100%x, 100%y)
mh1=(pnlSelect2.Height/2) - (PanelMain.Height/2) + hc
mw1=pnlSelect2.Width/2 - (PanelMain.Width/2) + wc
mh2=PanelMain.Height
mw2=PanelMain.Width
pnlSelect2.AddView (pnlInput2, mw1, mh1, mw2, mh2)
If ani = 1 Then '1 set animation flag to on, 0 equals off
pnlSelect2.Left = 601
Do While pnlSelect2.Left > mw1
If pnlSelect2.Left- anispd > mw1 Then
pnlSelect2.Left = pnlSelect2.Left - anispd 'anispd is animation speed, set to around 70, larger for faster speed.
Else
pnlSelect2.Left = mw1
End If
DoEvents
Loop
End If
End Sub