我正在使用this解决方案(第一个答案)制作热键。所以,它有事件处理程序方法:
static void HotKeyManager_HotKeyPressed(object sender, HotKeyEventArgs e)
{
Console.WriteLine("Hit me!");
}
如何在那里获取我的表单实例?我尝试用main方法创建一个类的静态字段,但我有System.ArgumentException: Controls created on one thread cannot be parented to a control on a different thread.
如何做?