CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of anonymous delegate
C#
// Create a handler for a click event
button1.Click += delegate(System.Object o, System.EventArgs e)
                   { System.Windows.Forms.MessageBox.Show("Click!"); };
 
// Create a delegate instance
delegate void Del(int x);
 
// Instantiate the delegate using an anonymous method
Del d = delegate(int k) { /* ... */ };
by bnaya   January 16, 2010 @ 2:50am
212 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate