Click here to Skip to main content
15,905,915 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Generating Barcodes from VB.Net Pin
j45mw3-Apr-05 19:49
j45mw3-Apr-05 19:49 
GeneralRe: Generating Barcodes from VB.Net Pin
Anonymous5-Apr-05 10:45
Anonymous5-Apr-05 10:45 
Generalfont names in combo box Pin
sam_pune2-Apr-05 4:20
sam_pune2-Apr-05 4:20 
GeneralRe: font names in combo box Pin
Dave Kreskowiak3-Apr-05 4:32
mveDave Kreskowiak3-Apr-05 4:32 
GeneralFoldercopyprogress shown in progressbar Pin
Wassilli2-Apr-05 2:47
Wassilli2-Apr-05 2:47 
GeneralRe: Foldercopyprogress shown in progressbar Pin
skrtbh2-Apr-05 4:54
skrtbh2-Apr-05 4:54 
GeneralRe: Foldercopyprogress shown in progressbar Pin
Wassilli2-Apr-05 21:24
Wassilli2-Apr-05 21:24 
GeneralRe: Foldercopyprogress shown in progressbar Pin
Dave Kreskowiak3-Apr-05 4:21
mveDave Kreskowiak3-Apr-05 4:21 
In order for a Progress Bar to work, you need two things. You need to know how much work your doing (total number of files or total size of all files) and a mechanism to report how far you've gotten through that work. Using the FileSystemObject .CopyFolder method won't give you either of those.

In order to get the total amount of work to be done, you'll need to either count the number of files in the source directory (and all subdirectories) or the number of bytes in those files. Either way, the data collection method is the same. Use a recursive function, that takes a full fileystem path as a parameter and returns the total number of files/bytes in that folder and all subfolders, to enumerate all the files in a folder, then call itself with the path to each one of the subdirectories, one at a time.

Now, copying the files follows the same rescursive method, but it updates the Progress Bar with how many files/bytes have been copied. If you're counting files, then all you need to do is call File.Copy with the full path to the source and destination filenames. Update the Progress Bar after each file copy is completed. If you're counting bytes, that gets a little more complicated. But just write your own Copy function that takes the same file path parameters for source and destination. This function will then have to open the source file (Binary mode preferrably), read a block of bytes and copy them to the destination file. Update the Progress Bar with the number of bytes that have been copied.


RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: Foldercopyprogress shown in progressbar Pin
Wassilli3-Apr-05 4:57
Wassilli3-Apr-05 4:57 
GeneralError Exception Message when I close the app. Pin
viettho1-Apr-05 13:48
viettho1-Apr-05 13:48 
GeneralSetup a form for printing (VB6) Pin
PalleJensen1-Apr-05 13:15
PalleJensen1-Apr-05 13:15 
GeneralObject reference not set to an instance of an object Pin
VB.NET Newbie1-Apr-05 11:21
sussVB.NET Newbie1-Apr-05 11:21 
GeneralRe: Object reference not set to an instance of an object Pin
Dave Kreskowiak1-Apr-05 13:42
mveDave Kreskowiak1-Apr-05 13:42 
GeneralRe: Object reference not set to an instance of an object Pin
VB .NET Newbie1-Apr-05 15:26
sussVB .NET Newbie1-Apr-05 15:26 
GeneralCapslock status Pin
Mr Dabbah1-Apr-05 9:12
Mr Dabbah1-Apr-05 9:12 
GeneralRe: Capslock status Pin
Anonymous1-Apr-05 18:41
Anonymous1-Apr-05 18:41 
QuestionDrive mount/dismount notification ? Pin
MrBean1-Apr-05 5:03
MrBean1-Apr-05 5:03 
AnswerRe: Drive mount/dismount notification ? Pin
Anonymous3-Apr-05 9:34
Anonymous3-Apr-05 9:34 
AnswerRe: Drive mount/dismount notification ? Pin
Anonymous3-Apr-05 9:59
Anonymous3-Apr-05 9:59 
GeneralAccessor Properties in Forms Pin
maxmanzero1-Apr-05 4:58
maxmanzero1-Apr-05 4:58 
GeneralRe: Accessor Properties in Forms Pin
carlos_rocha3-Apr-05 23:08
carlos_rocha3-Apr-05 23:08 
GeneralIMAP Client Pin
M4nj_j1-Apr-05 4:37
M4nj_j1-Apr-05 4:37 
Questionplaying mpeg files How? Pin
stevekhan1-Apr-05 4:23
stevekhan1-Apr-05 4:23 
GeneralHelp file not getting focus on Dialog Form Pin
Rizwan Bashir1-Apr-05 1:38
Rizwan Bashir1-Apr-05 1:38 
GeneralRe: Help file not getting focus on Dialog Form Pin
Dave Kreskowiak1-Apr-05 2:23
mveDave Kreskowiak1-Apr-05 2:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.