Sendkey.send在子线程中发送的消息 ,Windows窗体无法接受。
定义一个主窗体的委托来处理这个事件
public static Form f1 = null;
在窗体启动的时候对该参数进行初始化:
f1= this;
在子线程中需要使用到的地方进行委托:
MethodInvoker B1 = new MethodInvoker(() =>
{
SendKeys.Send("%{F4}");
});
F10_check.Polycom.f1.Invoke(B1);