Einzelnen Beitrag anzeigen

alpha1

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

New TabSheet with TWebbrowser and TToolBar

  Alt 5. Jan 2006, 15:35
Hello, how can i make, that on the new opened TabSheet would be TWebbrowser and TToolBar(with all Buttons, ...)? Here is my code but with error:

Delphi-Quellcode:
procedure TForm1.NewTab;
var Tab: TTabSheet;
    Browser: TWebBrowser;
begin
 Tab:= TTabSheet.Create(PageControl1);
 Tab.PageControl := PageControl1;
 Tab.Parent := PageControl1;
 Tab.PageIndex := PageControl1.ActivePageIndex + 1;
 ToolBar2.Create(Tab);
 TControl(ToolBar2).Parent := Tab;
 ToolBar2.Align := alTop;
 Browser:= TWebBrowser.Create(Tab);
 TControl(Browser).Parent := Tab;
 Browser.Align := alClient;
 Browser.Silent := True;
 Browser.Visible := True;
 PageControl1.ActivePage := Tab;
 Browser.OnStatusTextChange := WebBrowser1StatusTextChange;
 Browser.OnTitleChange := WebBrowser1TitleChange;
 Browser.OnNewWindow2 := WebBrowser1NewWindow2;
 Browser.OnCommandStateChange := WebBrowser1CommandStateChange;
 ImageButton1.Enabled := False;
 ImageButton2.Enabled := False;
 Browser.Navigate('about:blank');
end;
This code opens new TabSheet with TWebbrowser and TToolBar but with error. Also in previous TabSheet this TToolBar lost...
Please help me
  Mit Zitat antworten Zitat