计算鼠标坐标是否在指定范围内

if (myDataGridView2.RectangleToScreen(myDataGridView2.ClientRectangle).Contains(Cursor.Position))            
  {
                label1.Text = "YES";
  }
posted @ 2012-10-13 17:28  perock  阅读(299)  评论(0编辑  收藏  举报