CPB Mailing List

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dragging & Drag Images



I'd be grateful for any advice or code showing how to use drag images.

I'm drag/dropping between Listviews andListboxes on various MDI child
forms and have derived a class from TDragObject to simplify this. I
notice that TDragObject & TImageList have numerous member functions
relating to drag images but I can't find any documentation showing how
they all fit together.

With regard to the recent discussion on detecting the Control key during drag/drop -
surely this should be done in a target components DragOver event
handler, after all you only need the alternate drag cursor when there's
a target to drop onto. Also this event is triggered even when the mouse
isn't moving. I do the following

if (GetKeyState(VK_CONTROL)>>1)
	// set alternate drag cursor
else
	// set normal drag cursor

// fool VCL into redrawing the cursor (very tacky!)
TPoint P;
GetCursorPos(&P);
SetCursorPos(P.x,P.y);

Steve


W Komornicki's Home Page | Main Index | Thread Index