AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

New TabSheet with TWebbrowser and TToolBar

Ein Thema von alpha1 · begonnen am 5. Jan 2006 · letzter Beitrag vom 5. Jan 2006
Antwort Antwort
alpha1

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

New TabSheet with TWebbrowser and TToolBar

  Alt 5. Jan 2006, 14: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
Benutzerbild von jim_raynor
jim_raynor

Registriert seit: 17. Okt 2004
Ort: Berlin
1.251 Beiträge
 
Delphi 5 Standard
 
#2

Re: New TabSheet with TWebbrowser and TToolBar

  Alt 5. Jan 2006, 14:37
Here is an error:

ToolBar2.Create(Tab); correct it must be:

ToolBar2:=TToolBar.Create(Tab);
Christian Reich
Schaut euch mein X-COM Remake X-Force: Fight For Destiny ( http://www.xforce-online.de ) an.
  Mit Zitat antworten Zitat
marabu

Registriert seit: 6. Apr 2005
10.109 Beiträge
 
#3

Re: New TabSheet with TWebbrowser and TToolBar

  Alt 5. Jan 2006, 15:06
While ToolBar2.Create() effectively reinitializes the ToolBar you already employ on your first tabsheet, ToolBar2 := TToolBar.Create() overwrites the global variable ToolBar2 you might use elsewhere to refer to the prevous instance. Think twice - normally only one toolbar is assigned to a form with a pagecontrol. Position is preferably on top of the form, right below the menu. If the user changes the active tabsheet, you query the state of the command buttons from the then active browser control.

marabu
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:25 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz