0

I have below code which gives me mouse location using Form1._MouseMove event, I also captured mouse location over pictureBox control using the same event and the same code.

The Code:

private void Form1_MouseMove(object sender, MouseEventArgs e)
        {
            yAxis = (((768 / 2) - Cursor.Position.Y) * 45 / (768 / 2));
            xAxis = (((1024 / 2) - Cursor.Position.X) * 45 / (1024 / 2));

            player.FlashVars = string.Format("YAxis={0}&Rot={1}", yAxis, xAxis);
        }

The problem is, I have AxShockwaveFlashObject and I need the mouse location over that too but the above code does not work on this control because it doesn't have AxShockwaveFlashObject1._MouseMove event. Can anyone please help me to solve this?

Note:

e.Location.X & e.Location.Y gave me same result.

iѕєρєня
  • 524
  • 4
  • 14

1 Answers1

0

I used below code to add MouseMove event to my control and assign Form1._MouseMove to it:

this.Controls["AxShockwaveFlashObject1"].MouseMove +=Form1_MouseMove;
iѕєρєня
  • 524
  • 4
  • 14