Chetan Navale

Chetan Navale

  • 1.7k
  • 32
  • 7.1k

To provide image path in winforms application

Apr 28 2012 1:31 PM
Hi,
I am creating an windows forms application, in which I wish to give image path to button to change its image on an event. I have tried doing it in the way below:
btnSave.Image = Image.FromFile(@"..\Images\Buttons\updateblkbutton.png");
while compiling it wont gives me any error but when I run it it will terminate giving an error of filenotfoundexception. Here Images is the folder inside my application folder. When I provide hard path (Full path along with Drive name and all folder names) insted of thoes dots it will run without any erros.
Can some let me know what should I need to change in the above line so that it will run correctly.



Answers (1)