Hello, how I can do?
Thanks and regards.
Sample Code:
Thanks and regards.
Sample Code:
B4X:
Sub Activity_Create(FirstTime As Boolean)
CreateButtons( 10 )
PressButton( 3 )
End Sub
Sub CreateButtons( iHowMany As Int )
Dim i As Int
'
For i=0 To iHowMany -1
Dim bt1 As Button
bt1.Initialize("bt1")
bt1.Tag = i
'
Activity.AddView(bt1, 10dip,10dip+(50*i),10%x,10%y)
Next
End Sub
Sub bt1_Click
Dim bt2 As Button = Sender
Log(bt2.Tag)
End Sub
Sub PressButton( iButtonNumber As Int )
bt1_Click ( iButtonNumber ) ' <--- ?????????????????????
End Sub