Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Drag & Drop für Ordner (https://www.delphipraxis.net/52397-drag-drop-fuer-ordner.html)

Brueckenhauer 29. Aug 2005 15:17


Drag & Drop für Ordner
 
Hallo,

ich habe eine normale Drag & Drop funktion womit ich Dateien in mein Programm ziehen kann, nun möchte ich aber einen Ordner auf mein Programm ziehen und dann sollen alle Dateien in meine Listbox aus dem Ordner geschrieben werden, wie bekomme ich das hin das bei einem Ordner alle Dateien gelistet werden?

chaosben 30. Aug 2005 05:58

Re: Drag & Drop für Ordner
 
Probiers mal so:
Delphi-Quellcode:
procedure TForm1.JvDragDrop1Drop(Sender: TObject; Pos: TPoint;
  Value: TStrings);
var
  i : Integer;
begin
  for i:=0 to Value.Count-1 do
   begin
    if (DirectoryExists(Value[i])) then
       BuildFileList(IncludeTrailingPathDelimiter(Value[i])+'*.*',faAnyFile,Listbox1.Items);
   end;
end;
Die Funktion BuildFileList kommt aus der Unit JclFileUtils (Jedi3)


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:24 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz