Sub Activity_Create(FirstTime As Boolean)
Dim width, height As Int
'Cree des Panels
width = 300dip
height = 80dip
For y = 0 To 2
Dim P As Panel
Dim B1, B2 As Button
Dim L As Label
P.Initialize("")
P.Color = Colors.Blue
Activity.AddView(P,10dip, 10dip + y * (height + 10dip), width, height)
MyPanel(y) = P
B1.Initialize("BtnPre")
B1.Tag = y
B2.Initialize("BtnPost")
P.AddView(B1,10dip, 10dip, 50dip, 30dip)
MyButtonPre(y) = B1
L.Initialize("")
L.Color = Colors.Red
L.TextColor = Colors.White
P.AddView(L,100dip, 50dip, 100dip, 30dip)
MyLabel(y) = L
Next
End sub
Sub BtnPre_Click
Dim b As Button
b = Sender
Msgbox("This is panel: " & (b.Tag + 1), "")
End Sub