本帖最后由 yysyangyangyangshan 于 2011-09-21 10:36:41 编辑

解决方案 »

  1.   

    我打断点,当快速移动鼠标时mouse_Leave确实没有执行。
    再或者有没有别的方式可以实现 鼠标离开控件控件隐藏 这个功能呢?
      

  2.   

            private void OnMouseMove(object sender, MouseEventArgs e)
            {
                if ((e.X > 0) && (e.X < this.picture.Width)
                 && (e.Y > 0) && (e.Y < this.picture.Height))
                {
                    this.picture.BackgroundImage = this.bmpMouseOn;
                    SetCapture(this.picture.Handle);
                    this.Cursor = Cursors.Hand;
                }
                else
                {
                    this.picture.BackgroundImage = this.bmpMouseNotOn;
                    ReleaseCapture();
                    this.Cursor = Cursors.Arrow;
                }
            }
      

  3.   

    有可能是Lz在其他的鼠标事件中也写有代码,冲突了,变量溢出了等等
    或者是鼠标根本没进入panel而是晃过去了