Ja das ist klar, aber weiter?
Hab jetzt folgendes gefunden, aber irgendwie funkt der Code nicht
Delphi-Quellcode:
procedure TForm1.ListBox1DragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
begin
Accept := Source is TListbox;
end;
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 := -1;
TargetIndex := ItemAtPos(Point(X, Y), True);
if (ItemIndex > -1) and (TargetIndex > -1) then
Items.Move(ItemIndex, TargetIndex);
end;
end;
end;