EnableOLEDragMethod (Main Control) example for Delphi

Note:

Add two LEAD Main Controls to your Form (LEADImage1, LEADImage2).

Note:

Add two buttons and name them btnStartDrag and btnStopDrag.

procedure TForm1.btnStartDragClick(Sender: TObject);
begin
   LEADImage2.Load('v:\images\image1.cmp', 0, 1, 1 );
   LEADImage1.EnableOLEDragMethod := True;
   LEADImage2.EnableOLEDragMethod := True;

   LEADImage1.OLEDragCursor := Self.Icon.Handle;
   LEADImage2.OLEDragCursor := Self.Icon.Handle;
end;

procedure TForm1.btnStopDragClick(Sender: TObject);
begin
   LEADImage1.EnableOLEDragMethod:= False;
   LEADImage2.EnableOLEDragMethod:= False;
end;

procedure TForm1.LEADImage1OLEGiveFeedback(var bUseDefaultCursor: Boolean);
begin
   bUseDefaultCursor:= False ;
end;

procedure TForm1.LEADImage2OLEGiveFeedback(var bUseDefaultCursor: Boolean);
begin
   bUseDefaultCursor:= False;
end;