So a friend and myself are in a computer science course and for our final project we decided to really apply ourselves and add stuff into our assignment that we weren't taught throughout the year. Well we came to a wall when we decided to add an option to delete a selected item from a list box, the catch is in our assignment we had to use array's so when we add stuff to a list box and we delete it we clear an array and wipe an item from the list box. The thing is when we do this multiple times before re adding an item we can no longer at the same ammount of items to the list box that we set the array to. Any suggestions?
Here's the code we have for deleting a selected item..
Private Sub mnuDelete_Click()
Dim intRemove As Integer
If lstSongs.ListIndex > -1 Then
intRemove = lstSongs.ListIndex
lstSongs.RemoveItem lstSongs.ListIndex 'Deletes Selected items
End If
If intRemove = 0 Then
strSongList(0) = ""
ElseIf intRemove = 1 Then
strSongList(1) = ""
ElseIf intRemove = 2 Then
strSongList(2) = ""
ElseIf intRemove = 3 Then
strSongList(3) = ""
ElseIf intRemove = 4 Then
strSongList(4) = ""
End If
End Sub
*strSongList is declared in general and were on VB6