经测试 只要把下面的代码进行修改就可以实现了,我还是摆出来让大家看看吧,以防大家需要!
程序代码:
////////参考代码!!
////////Point point = this.PointToScreen(new Point(e.X, e.Y));
////////Rectangle rc = this.button1.RectangleToScreen(this.button1.ClientRectangle);
////////if (rc.Contains(point)) MessageBox.Show("button1 被经过了");