Board index » delphi » Drag Image control during drag & drop operations

Drag Image control during drag & drop operations

I want to display a specific image when I am doing drag & drop operations
between components on a form.  I have a list box object (ListBox1), and in
the 'OnBeginDrag' event, I create a custom TDragControlObject (that I
created), and associate a TImageList (with 1 icon in it) to the
TDragControlObject that I create.  Now, When I press the left mouse button
on ListBox1 to begin a drag, my custom drag image appears; however, as soon
as I move the cursor at all, the custom drag image 'disappears'.  As I
continue the drag operation, there doesn't appear to be anyway to get the
custom drag image to display again.  Interestingly enough, the 'TTreeView'
and 'TListView' objects display my custom drag image when the cursor is
moved over these components (and so does the Windows DeskTop).  But none of
the other objects on the form, including the form itself, will display my
custom drag image.  Any ideas would be appreciated.
 

Re:Drag Image control during drag & drop operations


Quote
In article <8lkc0a$q...@bornews.borland.com>, Andy Faust wrote:
> I want to display a specific image when I am doing drag & drop operations
> between components on a form.  I have a list box object (ListBox1), and in
> the 'OnBeginDrag' event, I create a custom TDragControlObject (that I
> created), and associate a TImageList (with 1 icon in it) to the
> TDragControlObject that I create.  Now, When I press the left mouse button
> on ListBox1 to begin a drag, my custom drag image appears; however, as soon
> as I move the cursor at all, the custom drag image 'disappears'.  

That is due to the fact that none of the standard controls with the exception
of tree and listview seem to have the csDisplayDragImage style in
ControlStyle. Don't ask me why. If you add this style to the listboxes
ControlStyle you will see the dragimage.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Other Threads