I am trying to delete an item in a listbox after selecting the item. For some reason, this has always been a problem in VBA, and I was hoping that a simple .DeleteItem would be available in Jabaco. Any suggestions?
Public Sub Form_Load()
List1.AddItem "now"
List1.AddItem "is the time"
List1.AddItem "for all good men ..."
End Sub
Public Sub Command1_Click()
Dim lm As javax#swing#DefaultListModel
If List1.ListIndex >= 0 Then
lm = Cast(List1.Parent.getModel(), javax#swing#DefaultListModel)
lm.removeElementAt(List1.ListIndex)
End If
End Sub
ListBox should have a removeElementAt() method in the Jabaco framework.