比较简单的方法是用异步调用.首先定义同要调用的函数具有签名的代表:private delegate void MoveDelegate(int x, int y);
MoveDelegate de = new MoveDelegate(Move);
de.BeginInvoke(.....);
在回调函数中de.EndInvoke(...);
具体可以看.NET帮助中的异步调用.
MoveDelegate de = new MoveDelegate(Move);
de.BeginInvoke(.....);
在回调函数中de.EndInvoke(...);
具体可以看.NET帮助中的异步调用.
class thd
{
int x;
int y;
public thd(int xx, int yy){x=xx;y=yy;}
public void thstart(){ start(x, y);}
public void start(int a, int b){...}}
thd t = new thd(3,4);
TheadStart myd = new TheadStart(t.thstart);
{
Thread thread; public MyThread(object args)
}args就可以作为参数传递