2007. november 7., szerda

new window in WebBrowser

Problem/Question/Abstract:


Answer:
{
Usually when you open a URL in new window in TWebBrowser it opens
the Internet Explorer. This tip creates a new instance of your
browser form and opens the new site in your browser.
}


procedure TForm1.WebBrowser1NewWindow2(Sender: TObject;
var ppDisp: IDispatch; var Cancel: WordBool);
var
NewWindow: TForm1;
begin
// a new instance of the form will be created
// Eine neue Instanz wird erstellt
NewWindow := TForm1.Create(self);

NewWindow.Show;
ppDisp := NewWindow.Webbrowser1.DefaultDispatch;
end;



Nincsenek megjegyzések:

Megjegyzés küldése