解决方案 »

  1.   

    Button b = new Button ();
    b.Click+= (a, b) => {  method(); };
      

  2.   

    Button b = new Button ();
    b .Click += delegate
     {
              MsgForm.Invoke(method,"测试")
    };
    MsgForm.Controls.Add(b);
      

  3.   


    可以了谢谢、不过“b.Click+= (a, b)”这是什么东东?第一次见
      

  4.   

    Lambda表达式。找一本C#入门教材先把基本语法熟悉下。
      

  5.   

    一样的呀 在按钮的Click事件你写
    public void btn_click(object sender, EventArgs e)
    {     
             if (t.InvokeRequired)
                {
                    UUChatMsg MsgForm = new UUChatMsg(method);
                    Invoke(MsgForm, t.text);
                }
                else
                {
                    method(t.text);
                }
    }