title: Winforms Designer Error "An error occured while parsing EntityName"
body: <p>I'am using a custom control code for my winforms application to create a custom colored progressbar. I can build it, and it works fine, BUT everytime I try to use designer, it crashes. "An error occured while parsing EntityName"</p>
  
  <ul>
  <li><p>If I add from the toolbox, <a href="http://img188.imageshack.us/f/43680242.jpg/" rel="nofollow">this is what I get</a>.</p></li>
  <li><p>If I insert a progressbar, then rewerite the code for my control (replace <code>progressBar</code> with <code>progressBarEx</code>), then <a href="http://img843.imageshack.us/f/47990282.jpg/" rel="nofollow">this is what I get</a>.</p></li>
  </ul>
  
  <p>The code:</p>
  
  <pre><code>using System.Drawing;
  using System.Windows.Forms;
  
  namespace Crystal
  {
  public class ProgressBarEx : ProgressBar
  {
      private SolidBrush brush = null;
  
      public ProgressBarEx()
      {
          this.SetStyle(ControlStyles.UserPaint, true);
      }
  
      protected override void OnPaint(PaintEventArgs e)
      {
          if (brush == null || brush.Color != this.ForeColor)
              brush = new SolidBrush(this.ForeColor);
  
          Rectangle rec = new Rectangle(0, 0, this.Width, this.Height);
          if (ProgressBarRenderer.IsSupported)
              ProgressBarRenderer.DrawHorizontalBar(e.Graphics, rec);
          rec.Width = (int)(rec.Width * ((double)Value / Maximum)) - 4;
          rec.Height = rec.Height - 4;
          e.Graphics.FillRectangle(brush, 2, 2, rec.Width, rec.Height);
      }
  }
  </code></pre>
  
  <p>}</p>