另外还请教一个问题.我现在是每次增加textContent的文本内容后,重新设置焦点让滚动框到textbox的底部
                        this.txtContent.SelectionStart   =   this.txtContent.Text.Length; 
                        this.txtContent.ScrollToCaret(); 有其他办法可以让滚动条自动到textbox的底部吗

解决方案 »

  1.   

     private void button1_Click(object sender, EventArgs e)
            {
                Thread trd = new Thread(new ThreadStart(this.DoAction));
                trd.IsBackground = true;
                trd.Start();       //执行线程
            }
            private void DoAction() //线程
            {
               string str="ppppppp";
               this.BeginInvoke(new System.EventHandler(BackAction), str);
            }
            private void BackAction(object o, System.EventArgs e)
            {
                this.textBox1.Text = o.ToString();
            }
      

  2.   

    invoke是在主线里面执行的,你这句段相当于在主线程中执行while,当然会假死你应该while在子线程中做,只有更新ui的才在invoke中做
      

  3.   

    大概可以参考如下文章http://blog.csdn.net/jinjazz/archive/2007/12/10/1927126.aspx
      

  4.   

    don't use EventWaitHandle in this situation,it can cause your form blocked and can't process any windows message,just use event 
      

  5.   

    do not  use   EventWaitHandle!