什么是“/”的关键枚举代码。键? [英] What is key enumeration code for "/" Key?

查看:94
本文介绍了什么是“/”的关键枚举代码。键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如我有窗口

For example i have window

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   x:Class="WpfApplication2.MainWindow"KeyDown="Window1_KeyDown_1">



我创建活动密钥own =Window1_KeyDown_1。

在这个事件中,当按下/按钮时我可以实现行为。

https://msdn.microsoft.com/ru-ru/library/system.windows.input.key %28v = vs.110%29.aspx [ ^ 告诉我这个密钥的代码是什么,来自Key Enumeration。


I creted Event KeyDown="Window1_KeyDown_1".
In this Event i can realize behavior when i press "/" button.
https://msdn.microsoft.com/ru-ru/library/system.windows.input.key%28v=vs.110%29.aspx[^] Tell me please what is code for this key,from Key Enumeration.

推荐答案

不,你没有创建一个事件。事件是这样的: https:// msdn .microsoft.com / zh-cn / library / system.windows.uielement.keydown%28v = vs.110%29.aspx [ ^ ]。



您最多创建了事件处理程序并将其添加到某些 UIElement 的事件实例的调用列表中,窗口在你的情况下;这就是你真正需要处理的事件。事件处理程序的代码示例显示在上面引用的MSDN页面上。



使用此事件,您需要使用属性 KeyEventArgs。传递给处理程序的事件参数实例的键,如同一代码示例所示。使用的密钥在这里:

https://msdn.microsoft.com/en-us/library/system.windows.input.key%28v=vs.110%29.aspx [ ^ ]。



-SA
No, you did not create an event. The event is this: https://msdn.microsoft.com/en-us/library/system.windows.uielement.keydown%28v=vs.110%29.aspx[^].

And you, at best, created the event handler and added it to the invocation list of the event instance of some UIElement, Window in your case; and this is what you really need to handle the event. The code sample for the event handler is shown on the MSDN page referenced above.

With this event, you need to use the property KeyEventArgs.Key of the event arguments instance passed to your handler, as shown in the same code sample. And the keys to use are here:
https://msdn.microsoft.com/en-us/library/system.windows.input.key%28v=vs.110%29.aspx[^].

—SA


这篇关于什么是“/”的关键枚举代码。键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆