Hi, a noob programmer just starting in C# with Visual Studio here....
I came across this while coding in Visual C# and I couldn't figure out anything about it so a little explanation would be greatly appreciated....
In Microsoft's Visual C#...when using Windows Forms for GUI.....
You guys know how there's a Design view and a Code view?,
and let's say you create a button1 on the Design view, and if you double click that on the Design view, Visual C# automatically generates an event handler linked to that button on the Code view like....
private void button1_Click(object sender, EventArgs e){
}
this might be a dumb question but I tried copying that code above and just pasted it into the Code view INSTEAD of letting it generate from the doubl-clicking and when I ran the program, the button didn't work.........Why is that???
The button's function only works if I generate the code by double-clicking it....
I'm guessing when you double click the button there's more to it than just the code automatically being generated?
Any explanation would be great.
Thank you guys.