在 wpf 中禁用退格 [英] Disable backspace in wpf

查看:38
本文介绍了在 wpf 中禁用退格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 WPF 应用程序中工作,使用 C#.net我想知道,有什么方法可以禁用特定 xaml 页面上的 Backspace 按钮.我想阻止用户在这个特定的 xaml 页面上使用 Backspace 按钮.即使用户按下 Backspace 按钮,也不会产生任何效果.

I am working in a WPF application, using C#.net I want to know, is there any way to disable Backspace button on a particular xaml page. I want to prevent user from using the Backspace button on this particular xaml page. Even if the user presses the Backspace button, no effect should take place.

谢谢

推荐答案

如果您想防止退格键返回 WPF 框架中的导航历史记录,包括特殊的后退"硬件按钮,请使用:

If you want to prevent backspace going back up the navigation history in a WPF Frame, including special "Back" hardware buttons, use:

NavigationCommands.BrowseBack.InputGestures.Clear();
NavigationCommands.BrowseForward.InputGestures.Clear();

这篇关于在 wpf 中禁用退格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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