我想捕捉删除键的按下,并且在按下该键时不执行任何操作。我如何在 WPF 和 Windows 窗体中做到这一点?
最佳答案
将 MVVM 与 WPF 结合使用时,您可以使用输入绑定(bind)在 XAML 中捕获按键。
<ListView.InputBindings>
<KeyBinding Command="{Binding COMMANDTORUN}"
Key="KEYHERE" />
</ListView.InputBindings>
关于c# - 如何在 C# 中捕获删除按键?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2893432/