Implementing drag and drop for picturebox?

  • Thread starter Thread starter juvi
  • Start date Start date
J

juvi

Hello,

I have a picturebox which has a standard position and three alternative
positions below (constant steps between pb.top)

If I press the key.down button the picturebox moves down to next position.

Now I want to implement an alternative navigation mode through drag and drop.
How can I get this work:
When the user clicks and moves the pb between position 0 and position 3
there should be some kind of "magnetic effect" to the alternativ positions
and when the user drops the pb it should move the position nearest to current
position. I have got also an int value for the position state (0 - 3) ...
this should also change

this is a little bit complicated now for me...maybe someone can help me.

thx
juvi
 
This would be easy to implement. You could do it using the MouseDown,
MouseMove and MouseUp events. You'd need to grab the mouse position on
MouseDown of the picture box (eventargs), then workout how far the stylus has
to move ie:- on MouseMov,e has it entered ay of the other 3 regions, if so
reposition it.
 
Back
Top