my issue is i need to wait 3-4 seconds after a button has been pressed before i can check for it, here is my code under button1_click:
While Not File.Exists(LastCap)
If the reason you are needing to wait is for the file to be created try using a
FileSystemWatcher and respond to the
Changed Events that way you are responding to an event rather than arbitrarily waiting a select period of time.
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click FileSystemWatcher1.Path = 'Your Path Here FileSystemWatcher1.EnableRaisingEvents = True 'Do what you need to todo to initiate the file creation End Sub Private Sub FileSystemWatcher1_Created(sender As Object, e As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Created, FileSystemWatcher1.Changed If e.Name = LastCap Then If (System.IO.File.Exists(e.FullPath)) Then FileSystemWatcher1.EnableRaisingEvents = False PictureBox1.Load(e.FullPath) End If End If End Sub