NMD
NMD

Reputation: 143

disable dialog webbrowser delphi

how to prevent the appearance of the dialog box This document has changed. save changes? which occurs in the transition when webbrowser about: blank

Thank you so much. did so

  Browser.Navigate ('about: blank');
  DesignMode (false ,'');
  Browser.OnNavigateComplete2: = NavigateComplite;

procedure NavigateComplite (ASender: TObject; const pDisp: IDispatch; var URL: OleVariant);
begin
  DesignMode (true ,'');
end;

Upvotes: 2

Views: 3108

Answers (1)

RRUZ
RRUZ

Reputation: 136391

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;

Upvotes: 3

Related Questions