RT
最好给代码,不要链接。

解决方案 »

  1.   


            TextBox tb = new TextBox();
            tb.TextChanged += new EventHandler(tb_TextChanged);        void tb_TextChanged(object sender, EventArgs e)
            {
                throw new Exception("The method or operation is not implemented.");
            }
      

  2.   


            private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)//工具栏
            {            if (e.ClickedItem.Text == "附件")
                {
                    if (openFileDialog1.ShowDialog() ==DialogResult.OK)
                    {
                        attach.Name = "attachs";
                        attach.Width = 550;
                        attach.Height = 21;
                        attach.Location = new Point(72, 68);
                        splitContainer1.Panel1.Controls.Add(attach);
                        lbl.Name = "fujian";
                        lbl.Text = "附件:";
                        lbl.Location = new Point(21, 68);
                        splitContainer1.Panel1.Controls.Add(lbl);
                        toolStrip2.Location = new Point(13, 98);
                        splitContainer1.SplitterDistance = 135;
                        filename = openFileDialog1.FileNames;
                       
                        foreach (string var in openFileDialog1.SafeFileNames)
                        {
                            attach.Text +=var+" ";
                        }
                        attach.TextChanged += new EventHandler(this.attach_TextChanged);
                    }
                }        }
            private void attach_TextChanged(object sender, EventHandler e)
            {
                if (attach.Text == "")
                {
                    splitContainer1.Panel1.Controls.Remove(attach);
                    splitContainer1.Panel1.Controls.Remove(lbl);
                    toolStrip2.Location = new Point(13, 68);
                    splitContainer1.SplitterDistance = 105;
                }
            }
    跟你的有区别吗?错误 1 “attach_TextChanged”的重载均与委托“System.EventHandler”不匹配
      

  3.   

    private void attach_TextChanged(object sender, EventHandler e)
    红字改为EventArgs
      

  4.   

    在VS中textbox.TextChanged += 后用2下TAB键,会自动出来,可以自己修改下托管函数的名称