Mouse Position

  • Thread starter Thread starter newbie_csharp
  • Start date Start date
N

newbie_csharp

Hi,

I'd like to know how to find the mouse position. I can use MouseMove
event of a form or pictureBox but the problem is when I move the mouse
over pictureBox, form_MouseMove event doesn't occur. I need to know how
to find the mouse position regardless the object.

thanks
 
private void pictureBox1_MouseMove(object sender,
System.Windows.Forms.MouseEventArgs e){
this.Form1_MouseMove(sender,e);
}

or register Form1_MouseMove with delegate of pictureBox.
 
Ashish,

nice solution. I didn't know we can do this. thanks a lot. before
getting your responde, I solved my problem by using GetCursorPos() API
function. but I will try your solution too (less using API functions).

thanks
 
Back
Top