'posLeft removed from Globals
Sub Button1_Click
Activity.AddView(CreatePanel, 5dip, posTop, 48%x, 48%x) 'height same as width
numPanels = numPanels +1
Activity.AddView(CreatePanel, 51%x, posTop, 48%x, 48%x)
numPanels = numPanels +1
posTop = posTop + 48%x + 5dip
End Sub
Sub CreatePanel () As Panel
Dim pnl As Panel
pnl.Initialize("MyPanels")
pnl.Tag = numPanels
pnl.Color = Colors.RGB(Rnd(0, 255), Rnd(0, 255), Rnd(0, 255))
Return pnl
End Sub
Sub MyPanels_Click
Dim p As Panel = Sender
Log($"You have clicked Panel # ${p.Tag}"$)
End Sub