Get a file in resource folder based on a value of a variable

  • Thread starter Thread starter Ahoking
  • Start date Start date
A

Ahoking

Guest
Hi

I have a program in vb that has multiple buttons, and when one of them is pressed they change a variable's value (i ll call it i here)

eg. button 1 is pressed, i = 1, button 2 is pressed, i = 2.

Then there is a picturebox that get pictures from a local folder

eg. button 1 is pressed, picturebox get ("location\on\my\computer\pic" & i & ".png"), so pic1.png is in the picturebox

I realised that the program will not work if i publish it and put it on another computer because the files will not be there. So i imported the pictures in the resources folder but i dont think it works with my.resources, so is there a solution to make it work like the original code?

Continue reading...
 
Back
Top