[RESOLVED] How raise event mouse click to the void(blank space) of listview
I want when i right click to void(black space) of listview the contextmenu will show.
How i do that ? I only did with click to item oF listview.:bigyello:
Re: How raise event mouse click to the void(blank space) of listview
You don't have to do anything. Just assign a ContextMenuStrip to the ContextMenuStrip property of the ListView and the menu will be displayed no matter where you right-click.
Re: How raise event mouse click to the void(blank space) of listview
Sorry, but i have 2 contextmenustrip. The first is for right clicking to items and i want the second is for right clicking to empty space of listview.
How can i do that.
Re: How raise event mouse click to the void(blank space) of listview
May I recommend that, in future, you provide the full story up front. Only with all the information can we provide informed advice.
Handle the MouseClick event, which provides coordinates. You can then use the GetItemAt or HitTest method to determine whether those coordinates are on an item or not.
Re: How raise event mouse click to the void(blank space) of listview