' Spinner RemoveAt - SelectedIndex not updating
Sub Globals
Dim s As Spinner
Dim b As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
' Spinner
s.Initialize("")
s.Add("Orange")
s.Add("Pear")
s.Add("Banana")
s.Add("Lemon")
s.SelectedIndex=2
' Button
b.Initialize("Button1")
b.Text="Remove item"
Activity.AddView(s,5dip,10dip,200dip,48dip)
Activity.AddView(b,10dip,70dip,150dip,50dip)
End Sub
Sub Button1_Click
If s.Size>0 Then
Log("spinner idx before removing item = " & s.SelectedIndex)
s.RemoveAt(s.SelectedIndex)
Log("spinner idx after removing item = " & s.SelectedIndex)
Log("# items remaining in list: " & s.Size)
Log("==================================")
End If
End Sub