I have to display a picture in a picture box in vb.net form but i donot want to give full path of the pic i want just to specify a relative path how it could be done
?????

Have you solved this problem? I need something like that, too... I think I could even use the full path, so if you have any code - please help!
THX:)

put the images beside the application and call it by its name directly
like

Image img = Image.FromFile(Application.StartupPath + ImageName + ".jpg); /* it returns the path needed to get the image*/

Hi Virus220

can you please tell me the code you normally use to display the full path of the image?

thanks

if the image is the same directory as your application:

My.Application.Info.DirectoryPath & "/myImage.jpg"

if the image is in My Documents folder

My.Computer.FileSystem.SpecialDirectories.MyDocuments & "/myImage.jpg"

should give you an idea ;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.