title: The function evaluation was disabled because of an out of memory exception
body: <p>i am getting this exception "The function evaluation was disabled because of an out of memory exception" from this line of code.  </p>
  
  <pre><code>this.pbErrorSign.BackgroundImageLayout =   System.Windows.Forms.ImageLayout.Stretch;
  </code></pre>
  
  <p>I have actually added a background image and many other images like to warning image and picture boxes instead of buttons to make attractive GUI. Program was running fine some time ago and now its giving me this.... help plz</p>
  
  <p>following code is from designer. </p>
  
  <pre><code> this.pbErrorSign.BackColor = System.Drawing.Color.Transparent;
          this.pbErrorSign.BackgroundImage = global::SAMS.Properties.Resources.ErrorSign3;
          this.pbErrorSign.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
          this.pbErrorSign.Location = new System.Drawing.Point(69, 121);
          this.pbErrorSign.Name = "pbErrorSign";
          this.pbErrorSign.Size = new System.Drawing.Size(30, 30);
          this.pbErrorSign.TabIndex = 1;
          this.pbErrorSign.TabStop = false;
  </code></pre>
  
  <p>following is the code of form named as errorDialogForm</p>
  
  <pre><code>public partial class ErrorDialogForm : Form
  {
      protected override void OnShown(EventArgs e)
      {
          base.OnShown(e);
          this.Capture = true;
      }
  
  
  
      public ErrorDialogForm()
      {
          InitializeComponent();
      }
  
      public string LabelText
      {
          get
          {
              return this.lblError.Text;
          }
          set
          {
              this.lblError.Text = value;
          }
      }
  
  
  
      private void pbOkButton_Click(object sender, EventArgs e)
      {
          this.Close();
      }
  
      private void pbOkButton_MouseEnter(object sender, EventArgs e)
      {
          this.pbOkButton.BackgroundImage = ((System.Drawing.Image)(Properties.Resources.purpleOkButton));
      }
  
      private void pbOkButton_MouseLeave(object sender, EventArgs e)
      {
          this.pbOkButton.BackgroundImage = ((System.Drawing.Image)(Properties.Resources.blueOkButton));
      }
  
  
  
      private void ErrorDialogForm_Enter(object sender, EventArgs e)
      {
          this.Close();
      }
  
      private void ErrorDialogForm_Deactivate(object sender, EventArgs e)
      {
          this.Close();
      }
  
      private void ErrorDialogForm_FormClosing(object sender, FormClosingEventArgs e)
      {
          this.Hide();
          this.Parent = null;
          e.Cancel = true;
      }
  
  
  }
  </code></pre>