C# find mouse location over AxShockwaveFlashObject control

时间:2015-05-12 22:46:35

标签: c# mouse-cursor mouse-position axshockwaveflash

I have below code which gives me mouse location using Dim type = ce.GetType() If type Is GetType(Int32) OrElse type Is GetType(UInt32) OrElse _ type Is GetType(Int64) OrElse type Is GetType(UInt64) Then value = ParseNumber(Text, target) ElseIf type Is GetType(Double) Then If target.Equals(GetType(Decimal)) Then value = ParseNumber(Text, target) ElseIf type Is GetType(String) Then value = ParseEnum(Text, target) End If event, I also captured mouse location over Form1._MouseMove control using the same event and the same code.

The Code:

pictureBox

The problem is, I have 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); } and I need the mouse location over that too but the above code does not work on this control because it doesn't have AxShockwaveFlashObject event. Can anyone please help me to solve this?

Note:

AxShockwaveFlashObject1._MouseMove & e.Location.X gave me same result.

1 个答案:

答案 0 :(得分:0)

我使用下面的代码将MouseMove事件添加到我的控件中并为其指定Form1._MouseMove

this.Controls["AxShockwaveFlashObject1"].MouseMove +=Form1_MouseMove;