Example #1
0
 private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         MouseDragging?.Invoke();
         MouseXPosition = e.X;
         MouseYPosition = e.Y;
     }
 }
Example #2
0
        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();
            }
        }