Sub Process_Globals
Private counter As Int
End Sub
Sub Globals
Private Scroll As ScrollView
Private LabelList As List
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
LabelList.Initialize
Scroll.Height=500
For i=0 To 9
Dim lbl As Label
lbl.Initialize("lbl")
lbl.Tag=i
Scroll.Panel.AddView(lbl,0,i*60,200,50)
lbl.Text="Label " & i
LabelList.Add(lbl)
Next
End Sub
Sub Button1_Click
counter=(counter + 1 ) Mod LabelList.Size
Dim lbl As Label=LabelList.get(counter)
lbl.Color=Colors.Red
End Sub
Sub lbl_Click()
Dim lbl As Label = Sender
Log(lbl.Tag)
End Sub