unit WebFrm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, SHDocVw, StdCtrls, ExtCtrls;
type
TWebForm =
class(TForm)
WebBrowser: TWebBrowser;
ActionPanel: TPanel;
UrlEdit: TEdit;
LoadButton: TButton;
procedure WebBrowserBeforeNavigate2(Sender: TObject;
const pDisp: IDispatch;
var URL, Flags, TargetFrameName, PostData,
Headers: OleVariant;
var Cancel: WordBool);
procedure LoadButtonClick(Sender: TObject);
end;
var
WebForm: TWebForm;
implementation
{$R *.dfm}
procedure TWebForm.WebBrowserBeforeNavigate2(Sender: TObject;
const pDisp: IDispatch;
var URL, Flags, TargetFrameName, PostData,
Headers: OleVariant;
var Cancel: WordBool);
begin
cancel := true;
end;
procedure TWebForm.LoadButtonClick(Sender: TObject);
begin
with WebBrowser
do begin
OnBeforeNavigate2 :=
nil;
Navigate(UrlEdit.Text);
OnBeforeNavigate2 := WebBrowserBeforeNavigate2;
end;
end;
end.