Hello everyone!
I had a quick question on how to use pictures in a VB program. What I'm trying to do is when someone selects an item in a listbox, to show the corresponding jpg file. I selected the relevant jpgs from the desktop, copied them to the clipboard and then pasted them into the resources folder by right clicking on resoruces in the solution explorer and selecting paste and now they are listed under resources.
However, when I goto run the program and select one of the listbox items, I get a FileNotFoundException. The names of the files that I use in the code match those of the jpeg files that I want to use in resources. I don't understand what I'm doing wrong.
Thanks.
Here's a copy of the relevant code....
If lstCarpets.SelectedIndex = 0 Then
picCarpet.Image = Image.FromFile("modern_geometric.jpg")
ElseIf lstCarpets.SelectedIndex = 1 Then
picCarpet.Image = Image.FromFile("tufenkian.jpg")
ElseIf lstCarpets.SelectedIndex = 2 Then
picCarpet.Image = Image.FromFile("MosqueDomee.jpg")