Dim panels(3) As Panel
For i = 0 To panels.Length - 1
panels(0).Initialize("panels")
panels(1).Initialize("panels")
panels(2).Initialize("panels")
panels(0).LoadLayout("left")
panels(2).LoadLayout("right")
panels(1).Color = Colors.Transparent
Dim lbl As Label
lbl.Initialize("")
lbl.Text = "I'm Panel: " & i
lbl.TextSize = 20
lbl.TextColor = Colors.White
panels(1).AddView(lbl, 20%x, 40%y, 60%x, 30dip)
Activity.AddView(panels(0), 100%x, 0, 100%x, 100%y - 80dip) 'add the panel to the layout
Activity.AddView(panels(1), 100%x, 0, 100%x, 100%y - 80dip)
Activity.AddView(panels(2), 100%x, 0, 100%x, 100%y - 80dip)
Activity.AddMenuItem("Panel #" & i, "Menu")