listview + selecteditem
-
Hi I always use the function 'selecteditem' of a listview to check what the selected item is. This works fine when there is something selected in the list .. when there are for example no entries it crashes on it. Code: This crashes when there is no entries in listview: msgbox lstArtikels.SelectedItem().Text how can i check if there are still entries in the list?
-
Hi I always use the function 'selecteditem' of a listview to check what the selected item is. This works fine when there is something selected in the list .. when there are for example no entries it crashes on it. Code: This crashes when there is no entries in listview: msgbox lstArtikels.SelectedItem().Text how can i check if there are still entries in the list?
Anonymous wrote: msgbox lstArtikels.SelectedItem().Text You can use SelectedItems.Count to see how many items are selected, then you can put up the Message Box:
If lstArtikels.SelectedItems.Count > 0 Then For X = 0 to lstArtikels.SelectedItems.Count - 1 MsgBox lstArtikels.SelectedItem(X).Text Next End If
RageInTheMachine9532