Registriert seit: 28. Apr 2008
1.717 Beiträge
FreePascal / Lazarus
|
Re: Items einer ListBox mittels DragDrop verschieben?
28. Mai 2009, 22:00
Hab das so gemacht:
Delphi-Quellcode:
procedure TForm1.ListBox1DragDrop(Sender, Source: TObject; X, Y: Integer);
var TargetIndex : Integer;
begin
if (Sender is TListBox) and (Source is TListBox) then
begin
with Sender as TListBox do
begin
TargetIndex := ItemAtPos(Point(X, Y), True);
if (ItemIndex > -1) and (TargetIndex > -1) then
begin
Items.Move(ItemIndex, TargetIndex);
ListBox2.Items.Move(ListBox2.ItemIndex, TargetIndex); <-----
end;
end;
end;
end;
Ist das ok was meinst du?
|
|
Zitat
|