Updating label during copy/move stalls.

  • Thread starter Thread starter Mugsy_in_Houston
  • Start date Start date
M

Mugsy_in_Houston

Guest
I perform a MoveDir inside a While loop:

For Each foundDir In My.Computer.FileSystem.GetDirectories(lblSrc.Text)
...
lblMessage.Text = "Moving..."
lblTarget.Text = strDestPath & "\" & strTargetFolder
Cursor = Cursors.WaitCursor
lblMessage.Refresh()
lblTarget.Refresh()
My.Computer.FileSystem.MoveDirectory(foundDir, strDestPath & "\" & strTargetFolder, True)
...
Next


"lblTarget"
shows the folder currently being moved. Sometimes it stops refreshing after only a couple of files and you can't tell anything is happening until the end.

How do I force the label to update so it shows every file being moved? (No solution that involves "pausing" the copy process for even a split second is an option because of the number of files being moved.)

TIA

Continue reading...
 
Back
Top