计算鼠标坐标是否在指定范围内
if (myDataGridView2.RectangleToScreen(myDataGridView2.ClientRectangle).Contains(Cursor.Position)) { label1.Text = "YES"; }
if (myDataGridView2.RectangleToScreen(myDataGridView2.ClientRectangle).Contains(Cursor.Position)) { label1.Text = "YES"; }