title: Making a background image scale with button size
body: <p>I'm trying to add some background images to a few buttons in my Win Forms application.  The three images are different sizes (ie pixel dimensions don't match, one is 128x128 and another is 256x256).  I need the buttons to be identical in size (otherwise the GUI is horribly asymmetrical).  Without changing the actual image files, how can I get the images to scale with button size?</p>
  
  <p>I've tried creating my own class, and adding an event handler for the button resize event, but that doesn't seem to work.  My code:</p>
  
  <pre><code>class CustomButton : Button {
  
          internal void CustomButton_Resize( object sender, EventArgs e ) {
              if ( this.BackgroundImage == null ) {
                  return;
              }
  
              var pic = new Bitmap( this.BackgroundImage, this.Width, this.Height );
              this.BackgroundImage = pic;
          }
      }
  </code></pre>
  
  <p>and in the form:</p>
  
  <pre><code>this.buttonOne.Resize += new System.EventHandler(this.buttonOne.CustomButton_Resize);
  </code></pre>
  
  <p>Forgot to mention, the above code does not resize the images at all.  The buttons still need to have different sizes to display the images completely.</p>