Dim panels(4) As Panel
Dim lt As Int=0
Dim tp As Int=0
For i = 0 To panels.Length - 1
panels(i).Initialize("panels")
panels(i).Color = Colors.RGB(Rnd(0, 255), Rnd(0, 255), Rnd(0, 255))
For j=0 To 50
Dim btn As Button
btn.Initialize("")
btn.Text="Hi"
panels(i).AddView(btn,Activity.Width/5*lt,Activity.Width/5*tp,100dip,100dip)
lt=lt+1
If lt=5 Then
tp=tp+1
lt=0
End If
If j=10 Then
Activity.AddView(panels(i), 100%x, 0, 100%x, 100%y - 80dip)
Activity.AddMenuItem("Panel #" & i, "Menu")
End If
Next
Next