Results 1 to 3 of 3

Thread: [RESOLVED] Pause code until code above is completed

  1. #1

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Resolved [RESOLVED] Pause code until code above is completed

    Ok i have this code on a button click hook
    Code:
                If CheckBox1.Checked = True Then
                    FileIO.FileSystem.CopyFile(IO.Path.Combine(Dir2TB.Text, LB1.SelectedItem.ToString), IO.Path.Combine(Dir2TB.Text, newpath), True)
                Else
                    FileIO.FileSystem.CopyFile(IO.Path.Combine(Dir2TB.Text, LB1.SelectedItem.ToString), IO.Path.Combine(Dir2TB.Text, newpath), True)
                    FileIO.FileSystem.DeleteFile(IO.Path.Combine(Dir2TB.Text, LB1.SelectedItem.ToString), FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently)
                End If
    but if the checkbox is not checked then i want it to wait until it has copied the file before deleting it because at the moment it deletes it quicker than it copies it and the file could be different size everytime so i cant just put a simple timer of say for example 5 seconds in. Please help, any is appreciated.

  2. #2
    PowerPoster Evil_Giraffe's Avatar
    Join Date
    Aug 2002
    Location
    Suffolk, UK
    Posts
    2,555

    Re: Pause code until code above is completed

    Are you sure you don't simply want FileIO.FileSystem.MoveFile(...) in the Else?

  3. #3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width