Keine Ahnung, ob der Code was taugt. hab eich aus meiner Code-Schnipsel-Sammlung:
Code:
OnMouseDown:
if Button = mbLeft then
begin
// Starten des Drag'n'Drop-Vorgangs der playlisteinträge
if Playlist.ItemAtPos(Point(x, y), True) > -1 then
begin
Playlist.BeginDrag(False);
end;
end;
OnDragOver:
begin
NewItemIndex := Playlist.TopIndex + (Y div Playlist.ItemHeight);
if NewItemIndex > Playlist.Items.Count -1 then
NewItemIndex := Playlist.Items.Count -1;
Playlist.Items.Move(Playlist.ItemIndex, NewItemIndex);
Playlist.ItemIndex := NewItemIndex;
Hauptfenster.Filelist.Items.Move(Playlist.ItemIndex, NewItemIndex);
Hauptfenster.Filelist.ItemIndex := NewItemIndex;
Accept := True;
end;
by Daniel B; Form.