Re:Can't see TDragObject.DragImage when dragging over other VC's
Quote
On Tue, 11 Nov 1997 17:58:07 -0600, WRL <Bill.Lin...@MCI.com> wrote:
>Kind reader;
>I have successfully created my TDragObject in the OnStartDrag event
>handler and loaded my TImageList. The drag image is visible, but only
>when dragging over 1) a Ttreeview or 2) outside of my Delphi forms. I
>have been studying the VCL source code, and experimented with calls to
>ShowDragImage and others, but all to no avail. The Delphi components
>are doing something that kills the underlying windows ImageList from
>showing its image during drag/drop operations.
>I'm sure it must be something simple, but I do not know what it is.
i found a reference to this problem in an earlier item in the news
group. The problem is that virtually all delphi's components are
created with the csDisplayDragImage NOT in the ControlStyle set.
Refer to help on ControlStyle.
I have worked around it by subclassing all components, and modifying
the Create constructor to add csDisplayDragImage to the ControlStyle,
eg:
TBorlandDidntGetThisRightForm = class(TForm)
constructor Create(AOwner : TComponent);override;
end;
constructor TBorlandDidntGetThisRightForm.Create(AOwner : TComponent);
begin
inherited;
ControlStyle := ControlStyle + [csDisplayDragImage];
end;
Possibly one can do this at runtime, altho i doubt it. My solution is
pretty horrific, when you start to think about it.
Chris