Ok i have this code on a button click hook
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.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


)
Reply With Quote
