I have a tree control that implements drag and drop. I use the overridden OnStartDrag () to get my own TDragObjectEx that shows the image when dragging. This works fine in the control tree, but as soon as I leave the control tree, the image disappears. The cursor remains, though.
I tried to implement OnDragOver to reset the image, but it does not work.
Any hints of this? I am using C ++ builder 2010, but delphi will do the same.
Update: The found csDisplayDragImage parameter for each control in the form elements, and in the form itself, solves this problem. Is there some automated way to set csDisplayDragImage in its entire form, rather than manually setting it to Create for each element?
void __fastcall TForm1::FormCreate(TObject *Sender)
{
ControlStyle << csDisplayDragImage;
RMU->ControlStyle << csDisplayDragImage;
Button1->ControlStyle << csDisplayDragImage;
}
source
share