Hi Ken,
Thanks very much for the input, but I still have a small problem.
When I use the code that you gave me the picturebox displays the "c:\bliss.jpg" picture without any problems, but when I modify the code like below, I get no picture in picturebox 2. Any ideas?
Private Sub TV1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TV1.AfterSelect
Try
Dim picname = FBD1.SelectedPath & "\" & TV1.SelectedNode.Text
pb1.Image = Image.FromFile(FBD1.SelectedPath & "\" & TV1.SelectedNode.Text)
Dim fs As New System.IO.FileStream(picname.ToString, IO.FileMode.Open)
Dim bm As New Bitmap(fs)
pb2.Image = DirectCast(bm.Clone, Image)
fs.Close()
bm.Dispose()
Catch ex As Exception
End Try
End Sub
Because I want the first picturebox to display my original picture and the second to display the altered picture, so when I click on another filename in the treeview the picture changes in the picturebox1 (pb1) but there is no picture displayed in the picturebox2 (pb2) in the form.
------------------Update-----------------------
I think I figured my problem out, since I'm using the same picture for both picturebox1 and 2, when I load the picture into picturebox1 with the image.fromfile it locks the file and picturebox2 cannot access the file, but when I change the code so both pictureboxes display the file from system.io.filestream the problem was solved...
Thanks for the help again...