Sub PressButton(i as integer)
Select i
Case 1
Case 2
.
.
End Select
End Sub
Sub CreateButtons
Dim i As Int
For i=0 To 9
Dim bt1 As Button
bt1.Initialize("bt1")
bt1.Tag = i
Activity.AddView(bt1, 10dip,10,10%x,10%y)
Next
End Sub
Sub AnotherSub
PressButton( 3 ) ' <-- That call to Sub PressButton, but that do not need it.
' I want to call bt1_Click with the tag of a button.
end Sub
Sub bt1_Click
dim bb As Button = Sender
log("The Button is: "&bb.tag)
PressButton(bb.tag) ' <--- That can not go there.
end Sub