Q:

c# delegates without params or return type

I can't find an explanation on the web to this type of code:
somebutton. Click += delegate
{
    somecode;
}

When and how can I use this?  What is it called?  MSDN gives me the impression that a delegate should always have a return type and a set of parameters, but this code indicates that you can add in pure expressions. 
Also, what does the "+=" mean here?  I know what it means if it'd been a string or a number, but how do you "add" a delegate?  Is this like just adding extra expressions to inside and at the bottom of an event handler's code?  Or what does the addition imply? 
Thnx in advance. 

A:

In this context, the keyword delegate is not used to define a delegate type but instead used to denote an anonymous method. 
As you may know already, Button. Click is called an event.  With an event, you add an event handler to it to get notified when the event occurs.  In this case, you will get notified when the button is clicked. 
That raises a question, "How do you add an event handler to an event?"  That's pretty easy, you just need to have a method that satisfies the required method signature.  You see, because Button. Click is defined as an event of type EventHandler, a method signature of the following is required to handle that event:
void MethodName (object sender, EventArgs e)

Normally, you can write a method like this one:
private void ButtonIsClicked(object sender, EventArgs e) {
    Console. WriteLine("Hello");
]

and add it to the event:
someButton. Click += ButtonIsClicked;

Therefore, to answer your question, the += operator is to add an event handler to an event. 
But you say, wait, my code snippet doesn't contain a method signature like that, why is it working? 
Sometimes people are lazy or they think writing a whole new method for a simple functionality is too verbose.  So they use the anonymous method to make the code more concise. ( Although not as concise as lambdas)
Now let's have a look at the syntax of anonymous methods:
delegate {/* Method body goes here */}

However, the signature is missing.  That's right.  Because anonymous methods are supposed to make your code concise, to save you the effort of writing the whole method signature. 
The compiler infers the method signature of anonymous methods at compile time.  This is what it thinks:

Ah, an anonymous method!  Let me see... Apparently this guy wants to add this method to Button. Click, so the method signature must be the same as that of EventHandler.  I will change the anonymous method to a real method and add that to the event instead. 

EDIT:
I mentioned about lambda expressions.  I think I should elaborate on that more as it makes the code even more concise! 
Suppose you have this code with an anonymous method:
someButton. Click += delegate {
    Console. WriteLine("Hello");
}

You can convert that to a lambda expression:
someButton. Click += (sender, e) => Console. WriteLine("Hello");

IMO, that's more concise that an anonymous method.  Please note that (sender, e) cannot be omitted  in the lambda expression.  It specifies the parameter list.  Also, it is recommended not to use lambda expressions when you want to write a very long method. 
EDIT:

What happens if I add two anonymous methods after one another... will the last one overwrite the first one? 

Let's see this in action:
someButton. Click += delegate { Console. WriteLine("Hi 1"); }
someButton. Click += delegate { Console. WriteLine("Hi 2"); }

And when you click the button, Hi 1 is printed out, then Hi 2 is printed out.  This means that when you add multiple event handlers to an event, they will be called in the same order as the were added. 
Furthermore, I want to show you another example of using anonymous methods.  Anonymous methods not only can be used in adding event handlers but also can be used in passing delegate type arguments. 
Let's you want to call this method:
public static void SomeMethod(Action a) {...}

You can do it the normal way:
public void MyAction () {
    Console. WriteLine("Hello");
}
// in some other method...
SomeMethod(MyAction);

Or you can use an anonymous method
SomeMethod(delegate {Console. WriteLine("Hello");});

Or you can even use a lambda expression
SomeMethod(() => Console. WriteLine("Hello"));

