Hi,

I'm fairly new to programming and I'm having a weird error in both the new Visual Studio Beta and Visual C# Express 2010.

Here's the issue: I create a new Windows Form Application and add a button on it. I double click the button to get this code automatically:

private void button1_Click(object sender, EventArgs e)
{
}

However, if I decide to delete these three lines, my program won't compile anymore. I've messed around with with VB.net before and this didn't happen. Is it normal? How can I fix it?

I realized that I can remove the code when I delete the button, but is there any other way? (If I double click on something by mistake for example.)

Thanks a lot!


Here's the error:

Error 1 'WindowsFormsApplication1.Form1' does not contain a definition for 'button1_Click' and no extension method 'button1_Click' accepting a first argument of type 'WindowsFormsApplication1.Form1' could be found (are you missing a using directive or an assembly reference?) C:\Users\Username\AppData\Local\Temporary Projects\WindowsFormsApplication1\Form1.Designer.cs 42 64 WindowsFormsApplication1