title: error : Value of 'null' is not valid for 'stream'
body: <p>I have opened <code>Resources.resx</code> file of a <em>WinForms application project</em> and copied images there. I am using the code shown below to get an image from the resources, but getting following error:</p>
  
  <blockquote>
    <p>Value of 'null' is not valid for 'stream'.</p>
  </blockquote>
  
  <p>The error occurs in this line:</p>
  
  <pre><code>btn.BackgroundImage = new Bitmap(
    System.Reflection.Assembly.GetEntryAssembly().GetManifestResourceStream(test));
  </code></pre>
  
  <p>Relevant code:</p>
  
  <pre><code>private void genericButton_event(object sender, EventArgs e)
  {
      var btn = (Button)sender;
      string test = "StudentModule.Properties.Resources" + btn.Name + ".png";
  
      //Getting the error here:
      btn.BackgroundImage = new Bitmap(System
                                         .Reflection
                                         .Assembly
                                         .GetEntryAssembly()
                                         .GetManifestResourceStream(test));
  }
  </code></pre>
  
  <p>The value of <code>test</code> is <code>"StudentModule.Properties.ResourcesbtnAbout.png"</code>, but I think it should be: <code>"StudentModule.Properties.Resources.btnAbout.png"</code>. I tried this line also but it's not working:</p>
  
  <pre><code>string test = "StudentModule.Properties.Resources." + btn.Name + ".png";
  </code></pre>
  
  <p>What is the mistake I am doing here?</p>