   [SlimDX, C#] React on mouse click
  Hello, developers.I have a panel (System.Windows.Forms.Panel) on my form. I use (a) panel surface for drawing.My panel must react on a mouse click (For example, a messagebox will appear). But mouse click event handler for my panel doesn't react on mouse clicks. I know, it's related with drawing. How can I get on it ? I guess, It's a very frequent question, but i can't figure out how to ask google about it ...   
  The MouseUp event fires after the mouse button has been pressed and is released.  You can check which button with the arguments passed to the event method.  MouseArgs I think.  it should work.-Devin   ;Quote:Original post by devroniousThe MouseUp event fires after the mouse button has been pressed and is released.  You can check which button with the arguments passed to the event method.  MouseArgs I think.  it should work.-DevinMy problem is that mouse events didn't fire.Or you talk about another mouse events ... Can you give me an example please ...   ;  Mind you this is for a Form but I would think the code is similar. So what is best is to override the OnMouseUp event method like this:[source lang = "c#"]   protected override void OnMouseUp(MouseEventArgs e)   {  base.OnMouseUp(e);  switch (e.Button)  { case MouseButtons.Left: //do code here for left button break; case MouseButtons.Right: //do code here for right button break; case MouseButtons.Middle: //do code here for middle button break;  }   };Quote:Original post by devroniousMind you this is for a Form but I would think the code is similar. So what is best is to override the OnMouseUp event method like this:As I told before, that event handler never fires ..;  Register your device with RawInput and then use the event handler from that.Alternatively you can write a wrapper around RawInput and poll it each frame for your mouse state.   