日期:2014-05-17 浏览次数:21260 次
public delegate void treeinvoke(int i);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Console.WriteLine("AAA");
System.Threading.Thread th = new System.Threading.Thread(new System.Threading.ThreadStart(this.startupdate));
th.IsBackground = true;
th.Start();
Console.WriteLine("BBB");
}
private void startupdate()
{
Console.WriteLine("CCC");
this.BeginInvoke(new treeinvoke(this.UpdateTreeView), 0);
Console.WriteLine("DDD");
}
private void UpdateTreeView(int j)
{
try
{
Console.WriteLine("EEE");
Thread.Sleep(5000);
Console.WriteLine("FFF");
}
catch (Exception ex)
{
}
}