How do I make pictureboxes move when I drag them?

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.
 
F

Franz

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top