Thema: Delphi WebBrowser1NewWindow2

Einzelnen Beitrag anzeigen

alpha1

Registriert seit: 19. Nov 2005
40 Beiträge
 
#1

WebBrowser1NewWindow2

  Alt 4. Jan 2006, 18:01
Hello! Why this code doesn`t work? It opens new TabSheet but new page doesn`t load. Only old page on new TabSheet is visible!!...

Delphi-Quellcode:
procedure TForm1.WebBrowser1NewWindow2(Sender: TObject;
  var ppDisp: IDispatch; var Cancel: WordBool);
var
  TabSheet: TTabSheet;
  Web: TWebbrowser;
begin
  TabSheet := TTabSheet.Create(Form1.PageControl1);

  with TabSheet do
  begin
    PageControl := Form1.PageControl1;
  end;
  Web := TWebbrowser.CreateParented(TabSheet.Handle);
  TabSheet.InsertControl(Web);
  TWinControl(Web).Align := alClient;
  ppDisp := (PageControl1.ActivePage.Controls[0] as TWebBrowser).DefaultDispatch;
  Web.OnNewWindow2 := Webbrowser1NewWindow2;
  PageControl1.ActivePageIndex := PageControl1.PageCount-1;
end;
And how can make, that different TWebbrowser`s TabSheet`s would be controlled with "Back, Forward, Home, ..." buttons individually? Please help me
  Mit Zitat antworten Zitat