Hello,
I think this can help:
private bool isPictureReadyToDrag;
private void SetPosition()
{
MyPictureBox.Location = new Point(MousePosition.X - this.Left - MyPictureBox.Width / 2, MousePosition.Y - this.Top - MyPictureBox.Height);
}
private void MyPictureBox_MouseMove(object sender, MouseEventArgs e)
{
if (isPictureReadyToDrag)
SetPosition();
}
private void MyPictureBox_MouseUp(object sender, MouseEventArgs e)
{
isPictureReadyToDrag = false;
}
private void MyPictureBox_MouseDown(object sender, MouseEventArgs e)
{
isPictureReadyToDrag = true;
SetPosition();
}