.flow()
它有点工作,但是当你移动它时会出现故障(图片框会迅速传送到屏幕周围)。 https://www.youtube.com/watch?v=hWazyAnGNBE
答案 0 :(得分:0)
您需要使用PointToClient
Form
方法
var relativePoint = this.PointToClient(new Point(X, Y));
// Or
var relativePoint = this.PointToClient(Cursor.Position);
Control.PointToClient Method (Point)
计算指定屏幕点到客户端的位置 坐标。
更新
private void Brick_MouseMove(object sender, MouseEventArgs e)
{
if (isDragging)
{
var relativePoint = this.PointToClient(Cursor.Position);
Brick1.Left = relativePoint.X;
Brick1.Top = relativePoint.Y;
}
}