winform AxShockwaveFlash控件 怎么才能做到类似mouseclick事件效果

2024-12-29 20:17:31
推荐回答(1个)
回答1:

重写控件就可以:
新的控件有MyMouseClick事件,跟正常控件事件一样使用就可以

public partial class MyFlashWave : AxShockwaveFlashObjects.AxShockwaveFlash
{

public event MouseEventHandler MyMouseClick;
public delegate void MouseEventHandler(object sender, MouseEventArgs e);
public class MouseEventArgs : EventArgs
{
}

private const int WM_LBUTTONDOWN = 0x0201;

protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
switch (m.Msg)
{
case WM_LBUTTONDOWN:
{
MyMouseClick(this, new MouseEventArgs());
}
break;
}
}
}