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.
To provide image path in winforms application
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


VulpesRank #55 · 29.2K reputationPosted Apr 28, 2012, 10:08 AM EDT