P
Patrick Dugan
Hello,
I'm trying to load different images (icons) into a PictureBox1.Image.
The first image loads just fine, but the second image always returns the
error "Invalid property used."
It doesn't matter what icons are loaded. The first always shows up and any
icons after that give me the error.
Here is the offending code:
The "DestinationPath" variable is the full path and filename of the icon
Private Sub LoadIcon()
Dim FStream As New FileStream(DestinationPath, FileMode.Open)
Try
PictureBox1.Image = System.Drawing.Image.FromStream(FStream)
Catch Err As Exception
MsgBox(Err.Message)
End Try
FStream.Close()
End Sub
Is there something I am forgetting to close or clear?
I'm trying to load different images (icons) into a PictureBox1.Image.
The first image loads just fine, but the second image always returns the
error "Invalid property used."
It doesn't matter what icons are loaded. The first always shows up and any
icons after that give me the error.
Here is the offending code:
The "DestinationPath" variable is the full path and filename of the icon
Private Sub LoadIcon()
Dim FStream As New FileStream(DestinationPath, FileMode.Open)
Try
PictureBox1.Image = System.Drawing.Image.FromStream(FStream)
Catch Err As Exception
MsgBox(Err.Message)
End Try
FStream.Close()
End Sub
Is there something I am forgetting to close or clear?