thread th=new thread(()=>{
control.invoke(new Action(()=>{
thread.sleep(5000);
}));
//dosometings
});
th.start();
这个线程里的dosometings将在5000毫秒后执行,invoke是在异步线程阻塞的,可以阻塞另一个线程,而begininvoke则相反是非阻塞异步执行
thread th=new thread(()=>{
control.invoke(new Action(()=>{
thread.sleep(5000);
}));
//dosometings
});
th.start();
这个线程里的dosometings将在5000毫秒后执行,invoke是在异步线程阻塞的,可以阻塞另一个线程,而begininvoke则相反是非阻塞异步执行