My current code but the result of n1,n2 are zero
Sub ShowPopupMenu(bShow As Boolean)
Dim n1,n2 As Int
n1 = (Activity.Width -Panel1.Width) Mod 2
n2 = (Activity.Height-Panel1.Height) Mod 2
Panel1.Left = n1
Panel1.Top = n2
Panel1.Visible = bShow
End Sub