RegisterHotKey - 如何获取表单实例?

时间:2012-07-09 14:13:49

标签: c# winforms events hotkeys registerhotkey

我正在使用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.如何做?

0 个答案:

没有答案
相关问题