I want to access my resources this way:
string iconVar = "20";
imgIcon.Image = "Properties.Resources." + iconVar;
This is not possible because I give a string and not an image.
So the question is, how can I access the resources without giving the name of the resource in the code?
I know normally you should use
imgIcon.Image = Properties.Resources.image1;
The thing is, I don't know yet if it's gonna be image1 or image 2 that I'm gonna use.
I tried this:
imgIcon.ImageLocation = "pack://application:,,,/project1;component/Properties.Resources._" + iconVar;
imgIcon.Refresh();
But that doesn't seem to work.