procedure TForm1.FormCreate(Sender: TObject);
var
ts: TTabSheet;
begin
stb:= TStatusBar.Create(Form1);
// StatusBar wird vom Programm erstellt
form1.InsertControl(stb);
wbb:= twebbrowser.Create(form1);
// Browser wird vom Programm erstellt
wbb.GoHome;
ts := TTabsheet.Create(PageControl2);
ts.Caption := wbb.LocationName;
// Funzt nicht
ts.PageControl := PageControl2;
PageControl2.ActivePage := ts;
wbb := TWebBrowser.Create(ts);
ts.InsertControl(wbb);
wbb.Align := alClient;
wbb:=GetCurrentWB;
wbb.GoHome;
wbb.OnNewWindow2 := wbbNewWindow2;
...
procedure TForm1.wbbNavigateComplete2(ASender: TObject;
const pDisp: IDispatch;
var URL: OleVariant);
Begin
wbb:=GetCurrentWB;
// Aktiven Browser ermitteln
edtAdresse.Text:=wbb.LocationURL;
...
procedure TForm1.btnNewTabClick(Sender: TObject);
// Neuen Tab öffnen
var
ts1: TTabsheet;
begin
ts1 := TTabsheet.Create(PageControl2);
ts1.PageControl := PageControl2;
PageControl2.ActivePage := ts1;
wbb := TWebBrowser.Create(ts1);
ts1.InsertControl(wbb);
wbb.Align := alClient;
wbb:=GetCurrentWB;
wbb.GoHome;
edtAdresse.Text:=wbb.LocationURL;
ts1.Caption := wbb.LocationName;
// Funzt nicht
pagecontrol2.ActivePage:=(ts1);
wbb.OnNewWindow2 := wbbNewWindow2;
end;
...
// Make TStatusbar to be the parent of any controls - Funzt nicht bei mehreren Tabs !!!
constructor TStatusBar.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
ControlStyle := ControlStyle + [csAcceptsControls];
end;
...
procedure TForm1.wbbProgressChange(ASender: TObject; Progress,
ProgressMax: Integer);
begin
if progressmax>0
then
stb.Panels[0].Text:=inttostr(round(Progress/progressmax*100));
end;
procedure TForm1.wbbStatusTextChange(ASender: TObject;
const Text: WideString);
begin
stb.Panels[1].Text:=Text;
end;