5,392
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.ListBox1DragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
begin
if Sender is TListBox then
Accept:=true;
end;
procedure TForm1.ListBox1DragDrop(Sender, Source: TObject; X, Y: Integer);
begin
TListBox(sender).Items.Add(TListBox(Source).Items[TListBox(Source).itemindex]);
TListBox(Source).Items.Delete(TListBox(Source).itemindex);
end;
if ((Source Is TFileListBox) and (Source <> Sender)) or ((Source Is TDirectoryListBox) and (Source <> Sender)) then
Accept:=True; // accept drag operation