Click here to Skip to main content
16,008,469 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: SHFormatDrive error Pin
DaveAuld7-Mar-10 4:09
professionalDaveAuld7-Mar-10 4:09 
GeneralRe: SHFormatDrive error Pin
Gagan.208-Mar-10 2:23
Gagan.208-Mar-10 2:23 
GeneralRe: SHFormatDrive error Pin
DaveAuld8-Mar-10 2:34
professionalDaveAuld8-Mar-10 2:34 
GeneralRe: SHFormatDrive error Pin
Gagan.2013-Mar-10 3:56
Gagan.2013-Mar-10 3:56 
QuestionCopy a whole directory with files and subfolders with progressbar in vb Pin
majan116-Mar-10 17:31
majan116-Mar-10 17:31 
AnswerRe: Copy a whole directory with files and subfolders with progressbar in vb Pin
Luc Pattyn6-Mar-10 18:09
sitebuilderLuc Pattyn6-Mar-10 18:09 
GeneralRe: Copy a whole directory with files and subfolders with progressbar in vb Pin
majan117-Mar-10 11:50
majan117-Mar-10 11:50 
AnswerRe: Copy a whole directory with files and subfolders with progressbar in vb Pin
Gregory Gadow8-Mar-10 6:55
Gregory Gadow8-Mar-10 6:55 
I've done something similar, involving copying a large number of files from one single folder into another. I started with a preliminary count of the number of files to be moved, then set the Maximum value of the progress bar to that number. Then, after copying each file, I incremented the progress bar value by one. The code looks like this:
AppMainForm.ProgressBarVisible = False
AppMainForm.ProgressBarMinimum = 1
AppMainForm.ProgressBarMaximum = Directory.GetFiles(ArchivePath).Length
AppMainForm.ProgressBarValue = 1
Dim DestPath As String = ""
For Each F As String In System.IO.Directory.GetFiles(ArchivePath)
    If AppMainForm.ProgressBarVisible Then
        AppMainForm.ProgressBarIncrement()
    Else
        AppMainForm.ProgressBarVisible = True
    End If
    DestPath = WebPath + System.IO.Path.GetFileName(F)
    My.Computer.FileSystem.CopyFile(F, DestPath, True)
Next

AppMainForm is the MDI for the app, implemented as an interface; the progress bar is exposed as various properties and methods through the interface. The method ProgressBarIncrement simply adds 1 to the progress bar's value.

You should be able to modify this to allow for a recursive copy as well. At a guess, I would thing a two pass system might work, one to create the folder structure and one to copy the files. It might be visually interesting to implement two progress bars, one showing the copying of the current folder and one marking overall progress.
Questionstoring input box values? Pin
toyman78516-Mar-10 13:41
toyman78516-Mar-10 13:41 
AnswerRe: storing input box values? Pin
Scott Dorman6-Mar-10 13:59
professionalScott Dorman6-Mar-10 13:59 
AnswerRe: storing input box values? Pin
Luc Pattyn6-Mar-10 14:39
sitebuilderLuc Pattyn6-Mar-10 14:39 
Questionprinting from file Pin
Daniel Engelkes6-Mar-10 11:35
Daniel Engelkes6-Mar-10 11:35 
QuestionRecognize Multiple keys being pressed Pin
Pugman8126-Mar-10 9:57
Pugman8126-Mar-10 9:57 
AnswerRe: Recognize Multiple keys being pressed Pin
Luc Pattyn6-Mar-10 10:14
sitebuilderLuc Pattyn6-Mar-10 10:14 
Questiontab spacing Pin
Daniel Engelkes6-Mar-10 9:34
Daniel Engelkes6-Mar-10 9:34 
AnswerRe: tab spacing Pin
Luc Pattyn6-Mar-10 10:18
sitebuilderLuc Pattyn6-Mar-10 10:18 
AnswerRe: tab spacing Pin
Dave Doknjas6-Mar-10 10:53
Dave Doknjas6-Mar-10 10:53 
QuestionURGENT--setting width of column in excel throgh code+vb Pin
chetan_agarwal5-Mar-10 22:57
chetan_agarwal5-Mar-10 22:57 
AnswerRe: URGENT--setting width of column in excel throgh code+vb Pin
Dalek Dave5-Mar-10 23:35
professionalDalek Dave5-Mar-10 23:35 
Questiontext box in VB application Pin
chetan_agarwal5-Mar-10 19:46
chetan_agarwal5-Mar-10 19:46 
AnswerRe: text box in VB application Pin
DaveAuld5-Mar-10 20:35
professionalDaveAuld5-Mar-10 20:35 
Questiondynamically writing text into word document using vb.net Pin
vijaylumar5-Mar-10 18:46
vijaylumar5-Mar-10 18:46 
AnswerRe: dynamically writing text into word document using vb.net Pin
Paramu19736-Mar-10 2:57
Paramu19736-Mar-10 2:57 
Questionstoring xml in database [solved] Pin
TremaHD5-Mar-10 5:53
TremaHD5-Mar-10 5:53 
AnswerRe: storing xml in database Pin
Dave Kreskowiak5-Mar-10 7:34
mveDave Kreskowiak5-Mar-10 7:34 

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.