用委托的异步来处理:
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();
}