Sub Globals
Dim LV As LayoutValues
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim i As Int
Dim v As String
Dim Button(4) As Button
LV = Activity.LoadLayout ("Layout1")
:
:
For i = 0 To Button.length - 1
Button(i).Initialize("btnEvent")
v = i
Button(i).Text=v
Button(i).Tag = v
Button(i).TextSize = 12.0
Button(i).TextColor = Colors.Red
Button(i).Typeface = Typeface.DEFAULT_BOLD
'Activity.AddView(Button(i), 5%x + (50*i), 10%y, 50*Dtc,50*Dtc)
Activity.AddView(Button(i), 5%x + (100*i), 10%y, 100*LV.Scale,50*LV.Scale)
Next
End Sub
Sub btnEvent_Click
Dim Send As Button
Send = Sender
ToastMessageShow("Button " & Send.Tag & " pressed.", True)
End Sub