日期:2014-05-20  浏览次数:20928 次

能否只响应父窗口的鼠标移动事件
在一个form中放一个控件,如picturebox,当鼠标从form进入picturebox时,能否继续响应form的mousemove事件

------解决方案--------------------
在控件的OnMouseMove事件中调用form的OnMouseMove.
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
Form1_MouseMove(sender, e);
}
------解决方案--------------------
private void pictureBox1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.pictureBox1.MouseMove+=new MouseEventHandler(Form1_MouseMove);
}
------解决方案--------------------
private void pictureBox1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.pictureBox1.MouseMove+=new MouseEventHandler(Form1_MouseMove);
}
就用这个