You can set the image displayed by a Win Forms PictureBox control at run time.
To set a picture at run time
[Visual Basic] Private Sub LoadNewPict() ' Change the path to a valid bitmap if needed: Dim path As String = "C:\Windows\WINLOGO.GIF" Set PictureBox1.Image = Image.LoadImage(path) End Sub [C#]
Icon (.ico) files contain separate images at different sizes and color depths to support a range of display devices. The LoadImage method's settings allow you to select images with specific color depths and sizes from an .ico file. In cases where an exact match to the requested settings isn't available, LoadImage loads the image with the closest match available.
To clear a graphic
[Visual Basic] Set Image1.Image = Nothing [C#]
PictureBox Control | Loading a Picture at Design Time | Modifying the Size or Placement of a Picture at Run Time