private void button1_Click(object sender, EventArgs e)
{
}
This is just another Method, a piece of code that does something. The name of the Method is button1_Click. It's called button1 because that's currently the Name of the button. When you changed the Text, Location, and Size properties of the button, you could have also changed the Name property from button1 (the default Name) to something else. The _Click part after button1 is called an Event. Other events are MouseDown, LocationChanged, TextChanged, and lots more. You'll learn more about Events later.
After _Click, and in between a pair of round brackets, we have this:
object sender, EventArgs e
These two are know as arguments. One arguments is called sender, and the other is called e. Again, you'll learn more about arguments later, so don't worry about them for now.Notice that there is a pair of curly brackets for the button code:
private void button1_Click(object sender, EventArgs e)
{
messagebox.show("HI welcome");
}
No comments:
Post a Comment