winform 判断鼠标是否在按钮控件范围内

         public void MourseLeave()
{
bool b = this.RectangleToScreen(this.ClientRectangle).Contains(MousePosition); //Point SQButtonPoint = this.PointToScreen(this.ClientRectangle.Location);
//Point MoursePoint = Control.MousePosition;
//bool MourseSQButton = SQButtonPoint.X + this.Width >= MoursePoint.X && MoursePoint.X >= SQButtonPoint.X && MoursePoint.Y >= SQButtonPoint.Y && SQButtonPoint.Y + this.Height >= MoursePoint.Y;
if (!b)
{
this.BackColor = _NormalColor;
}
}
上一篇:ibatis动态sql配置启动时提示:The content of elements must consist of well-formed character data...


下一篇:Cocos2D中Action的进阶使用技巧(二)