Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi some functions (https://www.delphipraxis.net/113110-some-functions.html)

mohfa 2. Mai 2008 20:09


some functions
 
i want to get The Contains from the Properties Window :
i mean when you RightClick on any Folder and click on Properties then you see the Tab General here you can see Contains : < x files , x folders > .
so is there any function or solution to get the Properties Contains Value without viewing the Properties Window .

also i have changed the MAX of a ProgressBar to 280 , how could i set a Label Caption to view the Progressbar step from 0 to 100 % , i mean for exemple when the ProgressBar is at step 280 ( the Last Step ) the Label Caption is 100 % . so the Progress Step of this Label is from 0 to 100 although the ProgressBar Step is from 0 to 280 .



Thank you all .

mkinzler 2. Mai 2008 20:18

Re: some functions
 
1) FindFirst()/FindNext() to enumerate the containing files
2) .Position / .Max

DeddyH 2. Mai 2008 20:29

Re: some functions
 
I did not surely understand what you mean about the properties. Do you want to know how many files and subfolders a folder contains?

And for your second question: it' s a simple calculation (percentage).
Delphi-Quellcode:
percent := Round(ProgressBar.Position / ProgressBar.Max * 100);
[edit] Wrong usage of colons :oops: [/edit]

mohfa 2. Mai 2008 21:08

Re: some functions
 
[quote="DeddyH"]I did not surely understand what you mean about the properties. Do you want to know how many files and subfolders a folder contains?
quote]

Yes , but i want to get the File Count in a folder directly i mean without the Use of FindFirst()/FindNext() because if i have 10000000 folders and subfolders this will take 1 Day to do the Calcul .

thank you

DeddyH 2. Mai 2008 21:11

Re: some functions
 
AFAIK the explorer does the same (FindFirst/FindNext). When I right-click a large folder and query its properties I can watch this behaviour.


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:22 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