Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.net ListView ContextMenuStrip on ListView right click to delete item

Hi

What VB.net code would I use to enable a user to right click on
a ListView item then delete that item

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

I am using built in controls
How do I gather the ListView item that I clicked on so that I can delete it
When you show the contextmenu in MouseClick event, save the X and Y location. Then use HitTest method of listview to find the item where mouse was clicked

http://msdn.microsoft.com/en-us/library/f7548bw9(v=vs.110).aspx
Thanks