Link to home
Start Free TrialLog in
Avatar of jonassondaniel
jonassondaniel

asked on

Drag & Drop between ListViews

How can I make a "Drag & Drop" between two ListViews?
I have a component that handles all other drag and drops such as: from the desktop, from explorer or any other file manager. However it doesn't work with another ListView.
ASKER CERTIFIED SOLUTION
Avatar of ZifNab
ZifNab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ZifNab
ZifNab

oops, has to be :

procedure TForm1.ListView1DragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
begin
 Accept := ((Source as TListView) = listview2);
end;

procedure TForm1.ListView1DragDrop(Sender, Source: TObject; X, Y: Integer);
begin
 if (sender as TListview) and ((source as TlistView)=listview2) then begin
  // do your drop stuff here.
 end;

And now I'm gone.

Zif.
end;