Skip navigation.

Where Is C# Heading?All recent postsAchieving Code Symmetry

Sleek Use of a Lambda Expression

I can’t recall where I found it, but here's a sleek way to employ a lambda expression:

SomeButton.Click += (sender, e) => { .... };

I’s one of those moments when you say to yourself, “But of course!”

Then there’s also this really short event handler syntax.

Comments

No comments yet

Emails and Notifications

Would you like to be notified when somebody responds to this post? 

TrackBacks

Sorry, TrackBacks are not allowed.

Submit your comment

Please enter only text since all HTML tags except hyperlinks will be stripped. Hyperlinks will become live links. Any comments with flaming or offensive language will be deleted. Be courteous to other posters. Thank you.

Your name (required):
Your email (optional):
Your site's URL (optional):
Enter this number
Type in the number above:
Comment (required):