Web浏览器控制窃取快捷方式

发布于 2024-07-15 20:34:24 字数 177 浏览 9 评论 0原文

我的 .NET Windows 窗体应用程序中的 Webbrowser 控件在聚焦时会窃取快捷方式。 为了能够使用 Alt + F4,我必须先单击一个控件。

目前“WebbrowserShortcuts = false”但它仍然相同。

有没有办法阻止这种令人恼火的行为?

Webbrowser Control in my .NET Windows Form application is stealing shortcuts when on focused. To able to use Alt + F4 I had to click a control first.

Currently "WebbrowserShortcuts = false" but it's still same.

Is there a way to stop this irritating behaviour?

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

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

发布评论

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

评论(1

旧梦荧光笔 2024-07-22 20:34:24

我在 winforms WebBrowser 中加载 Silverlight 时遇到了这个问题,我通过将以下内容添加到 元素来解决它:

onload="document.getElementById('silverlightControl').focus()"

...当然,这意味着我必须提供一个 id silverlightControl 到我的 元素:

<object id="silverlightControl" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">

如果您只有 HTML,也许您可​​以在 document< 上调用 focus() /code> 或者也许是第一个超链接?

I had this problem when loading Silverlight inside a winforms WebBrowser and I solved it by adding the following to the <body> element:

onload="document.getElementById('silverlightControl').focus()"

...which, of course, meant I have to give an id of silverlightControl to my <object> element:

<object id="silverlightControl" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">

If you only have HTML, maybe you can call focus() on the document or perhaps the first hyperlink?

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