在Delphi中禁用Twebbrowser上的键盘
我想禁用twebbrowser
的键盘,并避免使用 ctrl+ctrl+c 复制其中的信息。但是我找不到在twebbrowser
属性中禁用键盘的任何选项。
有办法这样做吗?
编辑:我看到了这个解决方案,但它不起作用。 禁用所有键
I want Disable Keyboard for TWebBrowser
and avoid copying information inside it using Ctrl+C. but I couldn't find any option for disable keyboard in TWebBrowser
properties.
Is there a way to do this?
EDIT: I saw this solution but it doesn't work.
Disable All Keypresses
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在应用程序级别上执行此操作,以防止将某些消息转发到
twebbrowser
组件。例如,通过使用tapplicationEvents
组件及其onMessage
事件处理程序:一个清洁的解决方案可以是在组件级别抑制此类消息,但是没有派遣的方法,但是我从未找到过一种方法为了使其与
twebbrowser
组件一起使用You can do that at the application level, preventing some messages to be forwarded to the
TWebBrowser
component. For example by using aTApplicationEvents
component and itsOnMessage
event handler:A cleaner solution could be to suppress such messages at the component level, but unforntunately I've never found a way to make that works with the
TWebBrowser
component@fabrizio
谢谢您的代码。此代码无法为Twebbrowser禁用键盘。
对于这个问题,我找到了一个称为 embeddedwb 的组件。它具有禁用上下文菜单的选项。
现在,使用您的代码(稍有更改)的复合选项使文本复制完全禁用。
结尾;
@Fabrizio
Thank you for your code. this code can not Disable Keyboard for TWebBrowser.
For this problem I found a component called EmbeddedWB. It have options for disable context menu.
Now Compound Options with your code (with a little change) makes text copying completely disabled.
end;