[問題]想讓BUTTON隨著滑鼠的位置而改變
我希望讓BUTTON2在過了特定的區域(例如:Ycoordinate <= 180)
的時候可以讓BUTTON2的位置移到目前滑鼠的位置(例如滑鼠的位置是(100,180))
程式碼如下:
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
if (Ycoordinate <= 180)
{
Point startingPoint1 = Cursor.Position;
startingPoint1.Offset(Cursor.Position.X, Cursor.Position.Y);
IsPainting = false;
Cursor.Position = (startingPoint1);
button2.Location = PointToScreen(startingPoint1);
button2.Visible = true;
}
}
為什麼這樣子跑不出我要的結果呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.114.54.99
※ 文章網址: http://www.ptt.cc/bbs/C_Sharp/M.1416319145.A.307.html
推
11/19 08:38, , 1F
11/19 08:38, 1F
→
11/19 08:39, , 2F
11/19 08:39, 2F
→
11/19 08:40, , 3F
11/19 08:40, 3F
→
11/19 08:40, , 4F
11/19 08:40, 4F
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章