如何在C#WPF中禁用特定键,例如ctrl,alt和shift [英] how to disable specific keys in C# WPF like ctrl, alt and shift
本文介绍了如何在C#WPF中禁用特定键,例如ctrl,alt和shift的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用键钩禁用特定键.我不想使用事件处理程序.我想实现Windows挂钩来禁用Ctrl,Alt,Shift和功能键之类的键.需要运行代码,我没有时间进行研发.尝试了几种代码,但没有用..我已经尝试过这些
http://www.aghausman.net/dotnet/disable-special- keys-in-win-app-c.html [ ^ ]
http://blogs.msdn.com/b/toub/archive/2006/05/03/589423.aspx [ ^ ]
How to disable specific keys using key hooks. i don''t want to use event handler. i want to implement windows hook to disable keys like ctrl, alt, shift and function keys. need the running code i have no time for r&d. tried several codes but not working.. i have tried these
http://www.aghausman.net/dotnet/disable-special-keys-in-win-app-c.html[^]
http://blogs.msdn.com/b/toub/archive/2006/05/03/589423.aspx[^]
推荐答案
您应重新访问此页面 ^ ]并阅读全部对该博客条目的评论.然后您就会知道哪里出了问题.
我敢打赌,您只是获取了代码,却从未花时间阅读整个页面.它并没有花我超过5分钟的时间.
干杯!
You should revisit this page http://blogs.msdn.com/b/toub/archive/2006/05/03/589423.aspx[^] and read all of the comments to that blog entry. Then you''d know where you had gone wrong.
I bet you just grabbed the code and never took the time to read the whole page. It did''nt take me more than 5 minutes.
Cheers!
这篇关于如何在C#WPF中禁用特定键,例如ctrl,alt和shift的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文