If you have a ContextMenu that is used by several, say ListViews, can you determine which ListView the menu was called from? I'd like to do this from one of the menu's MenuItems.
Thanks,
Mike
Printable View
If you have a ContextMenu that is used by several, say ListViews, can you determine which ListView the menu was called from? I'd like to do this from one of the menu's MenuItems.
Thanks,
Mike
use the ListView.SelectedItems property array, if you disable multiselect for the list view, simply use it as a single item array: ListView.SelectedItems(0)
Umm, I don't get it, maybe I wasn't clear. I have two ListViews and one ContextMenu. Both ListViews use the same ContextMenu. The ContextMenu's MenuItems are Large Icon, Details, Small Icon and List. What I want to do is change the view of the ListView based on what the user selects. But I need to know which ListView the user right-clicked on to bring up the ContextMenu. Not sure if I really need two ContextMenus that do the exact same thing except for the ListView it's acting on.
Reading you post again, TLord, that would work to find out which item in the list view was right clicked, but not which ListView.
use the ListViewItem.ListView read-only property.
This property includes reference to the ListView control that holds this ListView Item.