| View previous topic :: View next topic |
| Author |
Message |
mycwcgr Member
Joined: 08 Nov 2003 Posts: 2
|
Posted: 08/11/03 08:09 Post subject: How to exclude folder and subfolder in Tfilefind |
|
|
I use Tfilefind VCL,could you tell me how to exculde some files in a folder and its subfolder?
Sample:
I want to exclude ALL directories and files below the 'My Pictures' one, not just files inside of 'My Pictures'.
After I set filefind1.Excluded.add('c:\My Pictures\*.*'), the files in 'c:\My Pictures\cw\' and 'c:\My Pictures\cgr\' will not be excluded |
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 234
|
Posted: 08/11/03 12:34 Post subject: |
|
|
| Instead of the Excluded property you should use the OnFolderChange event. The Excluded property is for filtring files, not folders. |
|
| Back to top |
|
 |
mycwcgr Member
Joined: 08 Nov 2003 Posts: 2
|
Posted: 09/11/03 00:42 Post subject: Could you give me a sample about how to use OnFolderChange |
|
|
| Could you give me a sample about how to use OnFolderChange event to exclude folder? |
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 234
|
Posted: 09/11/03 11:23 Post subject: |
|
|
| Code: | procedure TForm1.FindFile1FolderChange(Sender: TObject;
const Folder: String; var IgnoreFolder: TFolderIgnore);
begin
if Pos('c:\my pictures\', LowerCase(Folder)) = 1 then
IgnoreFolder := True;
end; |
|
|
| Back to top |
|
 |
|