No overload for 'button1_Click' matches delegate 'System.EventHandler'
<p>I have this bit of code:</p>

<pre><code> using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
 using System.Drawing;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;

 namespace WindowsFormsApplication1
 {
     public partial class Form1 : Form
     {
         public Form1()
         {
             InitializeComponent();
         }
         public class vars
         {
             public static int x = 250;
             public static int y = 250;
         }
         private void button1_Click(object sender, EventArgs e)
         {
             button1.Visible = false;
             Pen main = new Pen(Color.Black);
             this.Graphics.DrawRectangle(main, vars.x, vars.y, 2, 2);
             while (true)
             {

             }
         }
      }
 }
</code></pre>

<p>But i keep getting an annoying error (No overload for 'button1_Click' matches delegate 'System.EventHandler') that I don't know how to approach. Ive been searching online and trouble shooting for a while, and have not found any answers. Any suggestions would be appreciated.</p>
