如何禁用WPF TextBox中的快捷方式

Ser*_*jev 7 wpf textbox keyboard-shortcuts

我想禁用WPF TextBox中的所有默认快捷方式.像Ctrl+ A,Ctrl+ V,Ctrl+ C等快捷方式可以这样做吗?在我看来,这些快捷方式是在KeyDown事件发生之前执行的

Jar*_*Par 3

您可以拦截事件中的击键PreviewKeyDown。将成员设置e.Handledtrue,这将阻止实际处理密钥。

  • 应更新 InputBinding 以使用 ApplicationCommands.NotACommand 来禁用它们。 (2认同)