WPF / Metro - 如何使 WebBrowser / WebView 控件忽略用户的所有输入

发布于 2024-12-23 00:04:08 字数 252 浏览 2 评论 0原文

基本上,我希望在 ScrollViewer 控件之上有一个 WebView(类似于 WPF 中的 WebBrowser)以利用某些 ScrollViewer 功能,但我不希望用户能够使用鼠标或直接与 WebView 进行交互触摸事件。相反,事件应该转到 ScrollViewer 进行处理。

但是,将 WebView 放在 ScrollViewer 之前、内部或之后不起作用。将 WebView 控件的 IsHitTestVisible 属性设置为 false 也不起作用。

Basically, I want to have a WebView (similar to WebBrowser in WPF) on top of of a ScrollViewer control to take advantage of some ScrollViewer functionality, but I don't want users to be able to interact directly with the WebView with the mouse or touch events. Instead, the events should go to the ScrollViewer to be handled.

However, putting the WebView before, inside, or after the ScrollViewer doesn't work. Setting the IsHitTestVisible property to false for the WebView control also doesn't work.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

奈何桥上唱咆哮 2024-12-30 00:04:08

我不确定您是否可以使用内置的 WebBrowser 来做到这一点,但您应该可以使用 Awesomium。它支持“无窗口渲染”,因此没有窗口句柄来获取焦点,这意味着它不会接受任何键盘或鼠标输入,除非您手动引导它们。

I'm not sure if you can do that with the built-in WebBrowser, but you should be able to do it with Awesomium. It supports "windowless rendering", so there's no window handle to take focus, which means it's not going to accept any keyboard or mouse input unless you manually direct them its way.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文