private void button1_Click(object sender, EventArgs e)
{
Button source = (Button)sender;
MessageBox.Show("The message inside the button is " + source.Text);
}
I am following a tutorial on C sharp's Event Handler , I was a Python user,
public static void Main()
{
Message myMessage = new Message();
myMessage.ShowMessage += new MessageHandler(myMessage.DisplayMessage);
}
I kind of know the basic syntax of creating new instances of a class now, but I don't get why there is a bracket for the Button in the first line.What are the differences between these two codes ?