![]() |
Re: Listbox Leeren
dann beschreib uns mal, was du geändert hast, damit sich die listboxen leeren lassen. am besten mit code.
|
Re: Listbox Leeren
[i]vorher
Delphi-Quellcode:
Nachher
function FindAllFiles(RootFolder: string; Mask: string = '*.*'; Recurse: Boolean
= True): TStinDynA; var //--Funktionsvariablen--------------------------------------------------------------------- Wn32FiDa: TWin32FindData; File0001: THandle; begin if AnsiLastChar(RootFolder) <> '\' then begin RootFolder := RootFolder + '\'; end; if Recurse then begin{if-1} File0001 := FindFirstFile(PChar(RootFolder + '*.*'), Wn32FiDa); if File0001 <> INVALID_HANDLE_VALUE then try {try(if-2)} repeat if Wn32FiDa.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY=FILE_ATTRIBUTE_DIRECTORY then begin if (string(Wn32FiDa.cFileName) <> '.') and (string(Wn32FiDa.cFileName) <> '..')then begin FindAllFiles(RootFolder + Wn32FiDa.cFileName, Mask, Recurse); end; end; until FindNextFile(File0001, Wn32FiDa) = False; finally windows.FindClose(File0001); end;{try(if-2)} end;{if 1} File0001 := FindFirstFile(PChar(RootFolder + '*.*'), Wn32FiDa); if File0001 <> INVALID_HANDLE_VALUE then try {try(if-4)} repeat if Wn32FiDa.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY <> FILE_ATTRIBUTE_DIRECTORY then begin gFileCont := length(gFile0001)+1; Setlength(gFile0001, gFileCont); gFile0001[gFileCont - 1] := RootFolder + String(Wn32FiDa.cFileName); end;{if-3} until FindNextFile(File0001, Wn32FiDa) = False; finally Windows.FindClose(File0001); end;{try(if-4)} end;{Funktion}
Delphi-Quellcode:
function FindAllFiles(RootFolder: string; Mask: string = '*.*'; Recurse: Boolean
= True): TStinDynA; var //--Funktionsvariablen--------------------------------------------------------------------- Wn32FiDa: TWin32FindData; File0001: THandle; begin SetLength(gFile0001, 0); //<= das hab ich eingefügt!! if AnsiLastChar(RootFolder) <> '\' then begin RootFolder := RootFolder + '\'; end; if Recurse then begin{if-1} File0001 := FindFirstFile(PChar(RootFolder + '*.*'), Wn32FiDa); if File0001 <> INVALID_HANDLE_VALUE then try {try(if-2)} repeat if Wn32FiDa.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY=FILE_ATTRIBUTE_DIRECTORY then begin if (string(Wn32FiDa.cFileName) <> '.') and (string(Wn32FiDa.cFileName) <> '..')then begin FindAllFiles(RootFolder + Wn32FiDa.cFileName, Mask, Recurse); end; end; until FindNextFile(File0001, Wn32FiDa) = False; finally windows.FindClose(File0001); end;{try(if-2)} end;{if 1} File0001 := FindFirstFile(PChar(RootFolder + '*.*'), Wn32FiDa); if File0001 <> INVALID_HANDLE_VALUE then try {try(if-4)} repeat if Wn32FiDa.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY <> FILE_ATTRIBUTE_DIRECTORY then begin gFileCont := length(gFile0001)+1; Setlength(gFile0001, gFileCont); gFile0001[gFileCont - 1] := RootFolder + String(Wn32FiDa.cFileName); end;{if-3} until FindNextFile(File0001, Wn32FiDa) = False; finally Windows.FindClose(File0001); end;{try(if-4)} end;{Funktion} |
Re: Listbox Leeren
:oops: ich bin so blöd!! :wall: :wall:
Ich habs falsch eingefügt. jetzt get's habs jetzt
Delphi-Quellcode:
und auf anhieb klapt's ohne Probleme
procedure TForm1.Btncopy0004Click(Sender: TObject);
begin SetLength(gFile0001, 0); //<= Hier ausprobiert!! LbxCopy0001.Items.clear; LBxCopy0002.Items.clear; EdtCopy0001.Text:=''; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:33 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz