Determine whether listview has a selected item

stustarz

Well-known member
Joined
Jan 10, 2003
Messages
246
Location
Earth
Hello all

I have a context menu attached to a list box that enables the user to open another form whose data is filtered by the selected items text - but if the listview isnt full then they are able to right click on an empty space and still use the menu - i would like to be able to prevent this

But how...

I have tried using an if statement to check if the selecteditem.text is empty but obviously if there isnt a selected item then it cant check for any text!

Any help would be appreciated.

Thanks

Stuart
 
Check listview.SelectedItems.Count to see if anything or nothing is selected.
 
Back
Top