Ok, lets see if I can explain myseflt: Basically, an Event needs a delegate of the method its supposed to call when the event fires. In your example:
private void AddButtons()
{
Button B1 = new Button();
B1.Text = "OK";
B1.Location = new System.Drawing.Point(8,8);
B1.Click += new System.EventHandler(buttonB1Click);
}
private void buttonB1Click(object sender, System.EventArgs e)
{
MessageBox.Show("Hello");
}
u are using a delegate although you might not be aware of it. The delegate type is: public delegate void EventHandler(object sender, System.EventArgs e); and the instance is pointing at buttonB1Click(object sender, System.EventArgs e) if u dont see it too clearly, use intellisense and create a new instance of the delegate: EventHandler handler=new EventHandler(.....); Anyway, u will see this more clearly when u try to create ur own Events for your own classes.