title: Drawing rectangle does not work in Windows Forms
body: <p>The program should draw a rectangle on click. But it does not. Maybe some problem with my understanding of delegates. What's the catch?</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Drawing;
  using System.Windows.Forms;
  
  namespace forms1
  {
      public partial class MainForm : Form
      {
          public MainForm()
          {
              //
              // The InitializeComponent() call is required for Windows Forms designer support.
              //
              InitializeComponent();
  
              //this.Paint+= new PaintEventHandler(MujPaintHandler);
  
              this.Click += new EventHandler(MujClickHandler);
  
          }
  
          public void MujPaintHandler(object sender,PaintEventArgs e)
          {
              Graphics gfx=e.Graphics;
              gfx.FillRectangle(new SolidBrush(Color.DarkViolet),100,100,200,200);
          }
  
          public void MujClickHandler(object sender,EventArgs e)
          {
              this.Text="aaaaa";
              this.Paint+= new PaintEventHandler(MujPaintHandler);
          }
  
      }
  }
  </code></pre>