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