// 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.
delegate void Del(int x);

// Instantiate the delegate using an anonymous method.
Del d = delegate(int k) { /* ... */ };



void StartThread()
{
    System.Threading.Thread t1 = new System.Threading.Thread
      (delegate()
            {
                System.Console.Write("Hello, ");
                System.Console.WriteLine("World!");
            });
    t1.Start();
}

http://msdn.microsoft.com/zh-cn/library/0yw3tz5k

相关文章:

  • 2022-02-05
  • 2022-12-23
  • 2021-11-10
  • 2021-09-17
  • 2021-10-16
  • 2021-10-19
  • 2021-05-24
猜你喜欢
  • 2021-09-19
  • 2021-08-03
  • 2022-12-23
相关资源
相似解决方案