Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
For c = 1 To 4
Dim lbCl As Label
lbCl.Initialize("lbName")
lbCl.TextSize=14
Dim cdWhite As ColorDrawable' note that i create a NEW ColorDrawable for each label.
cdWhite.Initialize(Colors.White,5)
lbCl.Background=cdWhite
lbCl.TextColor=Colors.Blue
lbCl.Text=Rnd(1,5)
lbCl.Tag=c
lbCl.Gravity=Gravity.CENTER
Activity.AddView(lbCl,0,c*65dip,100dip,60dip)
Next
End Sub
Public Sub lbName_Click
Dim LBL As Label = Sender
LBL.Color=Colors.Red
End Sub