你要看那个e是谁发出来了,e.X和e.Y用的是事件发起者的坐标。比如:void pictureBox1_MouseMove(object sender, MouseEventArgs e) { Point locationInScreen = (sender as PictureBox).PointToScreen(e.Location); Point locationInParent = (sender as PictureBox).Parent.PointToClient(locationInScreen); (sender as PictureBox).Location = locationInParent; }
{
Point locationInScreen = (sender as PictureBox).PointToScreen(e.Location);
Point locationInParent = (sender as PictureBox).Parent.PointToClient(locationInScreen); (sender as PictureBox).Location = locationInParent;
}