gpt4 book ai didi

.net - 网络浏览器控制窃取快捷方式

转载 作者:行者123 更新时间:2023-12-03 17:21:42 27 4
gpt4 key购买 nike

我的 .NET Windows 窗体应用程序中的 Web 浏览器控件在获得焦点时会窃取快捷方式。能够使用Alt + F4我必须先单击一个控件。

当前为“WebbrowserShortcuts = false”,但它仍然相同。

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

最佳答案

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

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

...当然,这意味着我必须给出 silverlightControl 的 id给我的 <object>元素:
<object id="silverlightControl" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">

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

关于.net - 网络浏览器控制窃取快捷方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/692620/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com