开发者

How to use ModifierKeys in a class

I need to access "ModifierKeys" from a class, not from a form (I have a reference to that form, but frm.Modifierkeys is not allowed from the class). Is that po开发者_如何学JAVAssible, and if yes, how?

Thanks!


ModifierKeys is static so you should be able to just call

Control.ModifierKeys

Otherwise you can PInvoke the GetKeyState method.


If you can pass KeyEventArgs to your class (from a KeyUp or KeyDown event handler), you have access to the KeyEventArgs.Modifiers property.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜