//定义委托变量 public int getControlHandle() { if (this.InvokeRequired) { GetHandle_delegate d = new GetHandle_delegate(GetHandle_direct); return (int)this.Invoke(d); } else { return GetHandle_direct(); } }
private delegate int GetHandle_delegate(); //定义委托变量 public int getControlHandle() { if (this.InvokeRequired) { GetHandle_delegate d = new GetHandle_delegate(GetHandle_direct); return((int)this.Invoke(d)); } else { return(GetHandle_direct()); } }