Probably a really simple thing I have missed...
Buttons are in scrollview, on the buttonclick event I need to return the text of the button.
Whatever button is clicked the event ALWAYS returns 5 (the xth value of the loop). The designer has only the scrollview on it, no buttons.
Thanks!
Sub Globals
Dim ScrollView1 As ScrollView
Dim bt As Button
Dim pnl As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("sv1")
ScrollView1.Panel.Height = 2000
For i = 0 To 5
bt.Initialize("bt")'moving this about has no effect on the click
bt.Color=Colors.Yellow
bt.Text=i
ScrollView1.Panel.AddView(bt, 5dip, 5dip + i * 200dip, ScrollView1.Width - 10dip, 190dip)
Next
bt.Text=""
End Sub
Sub bt_click
Dim t As String = bt.Text
Msgbox(t,"click")
End Sub