private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { MouseDragging?.Invoke(); MouseXPosition = e.X; MouseYPosition = e.Y; } }
private void pictureBox1_MouseMove(object sender, MouseEventArgs e) { // mouse moving if (e.Button == MouseButtons.Left) { MouseXPosition = e.X; MouseYPosition = e.Y; //label1.Text = "cursor : x = " + MouseXPosition + " y = " + MouseYPosition + "MouseOnPictureBox = " + MouseOnPictureBox; MouseDragging?.Invoke(); } }