所以我试图将图片框移动到面板上。问题是图片框没有落在鼠标的坐标上,而是落在其他地方。
private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
pictureBox1.DoDragDrop(pictureBox1,DragDropEffects.Copy);
}
private void panel1_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Copy;
}
private void panel1_DragDrop(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Copy;
pictureBox1.Location = new Point(e.X,e.Y);
}
我的代码有什么问题?