本文介绍了禁用对话框webbrowser delphi的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何防止对话框出现此文档已更改。保存更改?在Web浏览器关于以下内容的过渡过程中出现:空白
how to prevent the appearance of the dialog box This document has changed. save changes? which occurs in the transition when webbrowser about: blank
非常感谢。
Browser.Navigate ('about: blank');
DesignMode (false ,'');
Browser.OnNavigateComplete2: = NavigateComplite;
procedure NavigateComplite (ASender: TObject; const pDisp: IDispatch; var URL: OleVariant);
begin
DesignMode (true ,'');
end;
推荐答案
我认为您正在使用属性从代码中的接口。
i think wich you are using the designMode
property from the IHTMLDocument2
Interface in your code.
您可以禁用将该属性设置为关的对话框。
you can disable the dialog box setting this property to 'Off'.
在切换到新页面之前尝试此代码
try this code before to change to the new page
(WebBrowser1.Document as IHTMLDocument2).designMode := 'off';
WebBrowser1.Stop;
这篇关于禁用对话框webbrowser delphi的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!