EnableOLEDragMethod (ImageList Control) example for Delphi
Note: |
Add two LEAD Image List Controls to your Form (LEADImgList1, LEADImgList2). |
Note: |
Also add two buttons and name them btnStartDrag and btnStopDrag. |
procedure TForm1.btnStartDragClick(Sender: TObject);
begin
LEADImgList1.LoadFromFile('c:\Image1.tif', 0, 0, -1);
LEADImgList1.AllowSelection := ALLOWSELECTION_SINGLE ;
LEADImgList1.EnableOLEDragMethod := True;
LEADImgList2.EnableOLEDragMethod := True;
LEADImgList1.OLEDragCursor := Self.Icon.Handle;
LEADImgList2.OLEDragCursor := Self.Icon.Handle;
end;
procedure TForm1.btnStopDragClick(Sender: TObject);
begin
LEADImgList1.EnableOLEDragMethod := False;
LEADImgList2.EnableOLEDragMethod := False;
end;
procedure TForm1.LEADImgList1OLEGiveFeedback(var bUseDefaultCursor: Boolean);
begin
bUseDefaultCursor:= False;
end;