How do I make pictureboxes move when I drag them?

  • Thread starter Thread starter cast
  • Start date Start date
C

cast

Hi,
I'm trying to make a sort of puzzle where users can click pieces
(pictureBoxes) and drag them to where they want them on the form,
however, when I click the pictureBoxes and drag them they don't
follow the mouse, instead they only jump to the place that I want
them to go when I release the mouse.

I've tried placing the code to tell the program where to put the
picturebox in the mousemove event, but it doesn't seem to solve it.

Can anyone tell me what I need to do to make them move properly?

Thanks.
 
cast said:
Hi,
I'm trying to make a sort of puzzle where users can click pieces
(pictureBoxes) and drag them to where they want them on the form,
however, when I click the pictureBoxes and drag them they don't
follow the mouse, instead they only jump to the place that I want
them to go when I release the mouse.

I've tried placing the code to tell the program where to put the
picturebox in the mousemove event, but it doesn't seem to solve it.

Can anyone tell me what I need to do to make them move properly?

Thanks.

I think you should redraw the form in mouse move event instead of only
redraw in mouse button up event.
 
Back
Top