title: How to set the background image of a panel from a resource file in C#?
body: <p>I want to change the background image of a panel in a C# <a href="http://en.wikipedia.org/wiki/Windows_Forms" rel="nofollow">Windows Forms</a> application. The image I want to set as the background is located in a resource folder in <a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Other_tools" rel="nofollow">Solution Explorer</a>. How do I use it in code?</p>
  
  <p>I tried this:</p>
  
  <pre><code>panel1.BackgroundImage = Properties.Resources.Chalkboard; 
  </code></pre>
  
  <p>But it didn't work.</p>