我想用Delphi做一个类似Windows资源的的应用程序。
其中有两个文件列表。如何编写拖拽事件实现文件或文件夹的移动。
望各位CSDN的朋友们多多指点!!!
不胜感激!!!

解决方案 »

  1.   

    {随手写的一个,用了两个FileList(设置他们的DragMode为dmAutomatic)}
    procedure TForm1.FileListBox2DragOver(Sender, Source: TObject; X,
      Y: Integer; State: TDragState; var Accept: Boolean);
    begin
      if Source is TFileListBox then Accept := True;
    end;procedure TForm1.FileListBox2DragDrop(Sender, Source: TObject; X,
      Y: Integer);
    begin
      if Source is TFileListBox then
      begin
        if TFileListBox(Source).Name = 'FileListBox1' then
        begin
          TFileListBox(Sender).Items.Add(TFileListBox(Source).Items.Strings[TFileListBox(Source).ItemIndex]);
        end;
      end;
    end;
    当然这远远不够,但基本上就是这么一回事。你根据你程序的需要去改吧。^_^
      

  2.   

    in filedrop event; you use var path (content is current file path)
    copyfile(path,destpath);
    then add list node.
      

  3.   

    http://www.2ccc.com/article.asp?articleid=1630
      

  4.   

    http://search.csdn.net/Expert/topic/1597/1597746.xml?temp=.5850794
    转帖