I have a problem trying to draw a rectangle on a panel. I created a class that has a function that does this but when I call it nothing happens. When I use the code from the function instead of the actual function it works. Any ideas? This is the code

```
    class Snake : Form1
    {
        public static int x = 20;
        public static int y = 20;
        public static int r = 20;

        public void Draw()
        {
            SolidBrush brush = new SolidBrush(Color.Green);
            Graphics G = panel1.CreateGraphics();
            G.FillRectangle(brush, x, y, r, r);
        }
    }

    //...

    private void panel1_MouseClick(object sender, MouseEventArgs e)
    {
        Snake s = new Snake();
        s.Draw();
    }

```