drawing a line with drag-drop functionality..?

saikrishnat

New member
Joined
Nov 15, 2004
Messages
1
Programming Experience
1-3
Hi all,
i want to draw a line on form load .
and then i shold be able to drag and drop it on the form anywhere.

i know how to create a line , but how to do drag-drop for it..?

ThanX
Sai
 
saikrishnat said:
Hi all,
i want to draw a line on form load .
and then i shold be able to drag and drop it on the form anywhere.

i know how to create a line , but how to do drag-drop for it..?

ThanX
Sai
Are you drawing on the form directly? Wouldn't be able to really move it to easily that way... detect mousedown on an object it's drawn on, then while it's down (hold in a bool) move based on offset + mouse location while in the boundaries of the window.... when mouseup, set bool to false...

That's how I'd go about doing it.. there might be a better method, but i don't know of it
 
draw it on a control (let's say, a transparent panel), then drag the control. It's "the better method".
 
Back
Top