- url
- The path for the image to display in the System.Windows.Forms.PictureBox.
If the url parameter indicates a local file, the recommended format is a local file path. For example, an image file named myPicture.jpg located at c:\ would be accessed by passing c:\myPicture.jpg for the url parameter. A full path, such as http://www.contoso.com/path/images/image.jpg, or a relative path, such as ./images/image.jpg, can be used. If a relative path is used, it will be considered relative to the working directory. A call to the PictureBox.Load(string) method sets the PictureBox.ImageLocation property to the value of url.
A call to the PictureBox.LoadAsync(string) method sets the PictureBox.ImageLocation property to the value of url. Besides calling the PictureBox.LoadAsync method, you must set the PictureBox.WaitOnLoad property to false to load an image asynchronously. When you load an image asynchronously, you can handle the PictureBox.LoadProgressChanged event to determine the progress of an image load or the PictureBox.LoadCompleted event to determine when an image load has completed. If an error occurs during an asynchronous image-loading operation, it will be caught and reported by the System.ComponentModel.AsyncCompletedEventArgs.Error property of the System.ComponentModel.AsyncCompletedEventArgs.