0

I am new to VB.net and have been able to write a test program from a user guide to display a .TIF in a picture box when selecting it from a dialog box. But when I try to select a TIF or another other type JPG, GIF etc from a file name I get the error:

System.IO.filenotfoundException occurred in System.Draawing.dll"

Here is my code:

PicTif.Image = Image.FromFile("c:\test.tif")
Victor Zakharov
  • 25,801
  • 18
  • 85
  • 151

1 Answers1

0

Check your spelling and see if the file does exist. You can protect your code.

Imports:

Imports System.IO

Code:

Dim path As String = "c:\test.tif"
If File.Exists(path) Then 
  PicTif.Image = image.FromFile(path)
End If
OneFineDay
  • 9,004
  • 3
  • 26
  • 37