File path in same folder question

  • Thread starter Thread starter Jlaz
  • Start date Start date
J

Jlaz

I want to know how to open a jpeg file into a pictureBox without explicitly
writing the entire path? Example in VB it would be written like:
pictureBox.image = (App.Path & "\MyFolder\Pics\MyPic.jpg")
 
Hi,

Assuming the path is relative to the application startup path, you can use this:

string path =
System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath,@"MyFolder\Pics\MyPic.jpg");

Hope this helps.

Best regards,

Rodger

Time Management Guide - Make better use of your time
<http://www.TimeThoughts.com/timemanagement.htm>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top