Hello, I have been stuck on this for a while so I thought I would ask you guys for help. I have been trying to get a PictureBox to load an image I choose in a FileListBox. Here is the code I have so far, and the error:
The error I get is:Code:Private Sub File1_Click() FileName = File1.Path If Right$(FileName, 1) <> "\" Then FileName = FileName & "\" FileName = FileName & File1.FileName Main.Show Main.Image.Picture = LoadPicture(File1.Path + File1.FileName) Me.Hide End Sub
Runtime error 53
File not found: 'e:\H\Picimage.jpg'
Now I know what is wrong here. The proper directory is e:\H\Pic\image.jpg
I tried to change line six of my code to: Main.Image.Picture = LoadPicture(File1.Path + "\" + File1.FileName)
But now i get runtime error 438:
Object doesn't support this property or method.
Any way to make this work?




Reply With Quote