鼠标拖拽图像

实现效果:

  

知识运用:

  PictureBox控件的MouseEnter事件

  窗体的MouseMove事件

实现代码:

       bool flag=false; 
    private void pictureBox1_MouseEnter(object sender, EventArgs e)
        {
            flag = true;
        }

        private void Form1_MouseMove(object sender, MouseEventArgs e)
        {
            if (flag)
                pictureBox1.Location = new System.Drawing.Point(e.X,e.Y);
        }

  

原文地址:https://www.cnblogs.com/feiyucha/p/10262124.html