Board index » delphi » Drag'n'Drop and DragImages

Drag'n'Drop and DragImages

Hi to all!
Although I feel I understand how to drag and drop controls, I still
can't figure out how to have my prog move the control (or an image)
around during the drag. I've tried to set left and top in OnDragOver,
but it is slow and fails when the mouse cursor is above the dragged
element.

Plus I don't understand anything from the help files (TDragImages
list, etc). What does "overloading virtual methods for dragobject and
dragimages" mean ?

Thanks for any input !
Damien.

 

Re:Drag'n'Drop and DragImages


Quote
"Damien P." wrote:
> Hi to all!
> Although I feel I understand how to drag and drop controls, I still
> can't figure out how to have my prog move the control (or an image)
> around during the drag. I've tried to set left and top in OnDragOver,
> but it is slow and fails when the mouse cursor is above the dragged
> element.

I've started playing with dragging and dropping controls recently myself,
but I find that I get adequate results by setting the visible property of
the control to false, and then drawing a FocusRect where the control will
be if the mouse is released. Then when the drop even occurs place the
control in the appropriate place and set the visible property to true.

NickG

Other Threads