用委托的异步来处理:  
   
  private   delegate   void   focusHandle();//定义委托  
  private   void   treeView1_AfterSelect(object   sender,   System.Windows.Forms.TreeViewEventArgs   e)  
  {  
  focusHandle   h   =   new   focusHandle(f);  
  h.BeginInvoke(null,h);//异步  
  }  
  private   void   f()  
  {  
  focusHandle   invoke   =   new   focusHandle(txtFocuse);  
  this.Invoke(invoke);  
  }  
  private   void   txtFocuse()  
  {  
  this.textBox1.Focus();  
  }
posted on 2009-12-31 19:53  WPF之家  阅读(225)  评论(0编辑  收藏  举报