Thanks for reply Morten !
I've been looking for a little bit simplier solution.
I need such thing to use in the next situation:
user clicks the item and wants to view a context menu, but menu shows
for selected item which is not always the item user clicks by right button
of the mouse.
P.S. retieving wich item was selected by using mouse coordinates looks for
me very hard.
"Morten Wennevik" <
[email protected]> ???????/???????? ? ????????
?????????: You can use the MouseDown event and check if the button was the right
mouse button
private void listBox1_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if(e.Button == MouseButtons.Right)
{
// right mouse button was clicked
}
}
You probably have to find out which item was "selected".
e.X and e.Y contains the coordinates of the click.