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