M
Mike Horton
Hi There
I'm trying to use a ContextMenuStrip on a Listview and have run into a
problem that I can't seem to find the answer for. The menu itself is working
great but it's showing no matter where I right-click in the ListView. I'm
trying to get it so that it only shows when the user has right-clicked on an
actual ListItem vs empty space in the form.
I've tried putting the following code in the Opening sub for the Listview
but I still get it popping up even though the SelectedItems=0.
If lvAdmin.SelectItems.Count > 0 Then
cmsListView.Visible = True
Else
cmsListView.Visible = False
End If
Any pointers to a solution would be greatly appreciatted.
I'm trying to use a ContextMenuStrip on a Listview and have run into a
problem that I can't seem to find the answer for. The menu itself is working
great but it's showing no matter where I right-click in the ListView. I'm
trying to get it so that it only shows when the user has right-clicked on an
actual ListItem vs empty space in the form.
I've tried putting the following code in the Opening sub for the Listview
but I still get it popping up even though the SelectedItems=0.
If lvAdmin.SelectItems.Count > 0 Then
cmsListView.Visible = True
Else
cmsListView.Visible = False
End If
Any pointers to a solution would be greatly appreciatted.