hopefully this wiil help you.,
/*------------------------------- code
--------------------------------*/
if ((e.Button == MouseButtons.Right) &&
(this.lvClients.SelectedItems.Count != 0))// &&
//(this.lvClients.SelectedItems[0].Focused == true))
{
CheckMenuItemEnable();
this.contextMenu.Show(this.lvClients,new Point(e.X,e.Y));
}
Sincerely,
simida
Pucca wrote:
> How can I tell a mouse right clicks over a listview item that's in a
> container panel. I only want to display a popup menu if the user right click
> the mouse over an item on the Listview. I don't not want to display this
> menu if a node selected on the listview but user right click over the empty
> space of the panel that contain the listview.
>
> The problem here is when I use the Listview's Click Event, I don't have ways
> to verify if the right mouse button is clicked, but with this event only
> occurs if the user is clicking on one of the item of the Listview control.
>
> If I use the ListView's MouseClick event, then I can't verify if the right
> click occurs over a Listview item. Can someone tell me how to solve this
> problem? Thanks.
> --
> Thanks.
|