Right Click vs. Left 
Author Message
 Right Click vs. Left

I am using alot of context menus in my app and i would like to select the
item by right clicking when it shows the context menu. But currently it only
works if i left click on the item then right click once it is highlighted.
(list box's etc...);

I thought there was a way to send a "click" to the screen. But i cannot find
it ... any help is appreciated.

Thank,
Bob;



Wed, 04 May 2005 02:03:49 GMT  
 Right Click vs. Left
Bob,
Are you using the MouseDown event. This works for me...

Private void listBox1_MouseDown
(objectsender,System.Windows.Forms.MouseEventArgs e)
{
  int i,y;
  if(e.Button == MouseButtons.Right)
  {
        y = e.Y;
        i = y / listBox1.ItemHeight;
        if(i < listBox1.Items.Count)
        s = listBox1.Items[i].ToString();
        Invalidate();
  }

Quote:
}
>-----Original Message-----
>I am using alot of context menus in my app and i would
like to select the
>item by right clicking when it shows the context menu.

But currently it only
Quote:
>works if i left click on the item then right click once
it is highlighted.
>(list box's etc...);

>I thought there was a way to send a "click" to the

screen. But i cannot find
Quote:
>it ... any help is appreciated.

>Thank,
>Bob;

>.



Wed, 04 May 2005 23:54:53 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Detect left vs. right click event

2. Right Click in ListBox (or overiding left).

3. mouse up/down vs click/double click delegates

4. IDE Crashing left and right, impossible to use

5. How to move 3 bits from left to right

6. Right-Left Rule ... Please Help

7. Left Shift Key OR Right Shift key is pressed

8. Need help with string functions: LEFT, RIGHT and MID

9. OnKeyDown: Up, Down, Left, Right never triggered

10. string funktion like right, left, mid

11. right-to-left traversal twalk function?

12. library to support right to left script?

 

 
Powered by phpBB® Forum Software