unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls,ShDocVw, ExtCtrls, OleCtrls;
type
TForm1 =
class(TForm)
PageControl1: TPageControl;
Button1: TButton;
Panel1: TPanel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
ttabsheet2 =
class(TTabsheet)
webbrowser: TWebbrowser;
alarmlist : TComboBox;
alarmpanel: TPanel;
private
public
constructor create(AOwner:TComponent);
override;
destructor destroy;
override;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
constructor TTabSheet2.create(AOwner:TComponent);
begin
inherited create(AOwner);
self.Align:=alClient;
self.Color:=0;
webbrowser:=Twebbrowser.Create(self);
alarmpanel := TPanel.Create(self);
alarmlist := TCombobox.Create(self);
end;
destructor TTabsheet2.destroy;
begin
alarmpanel.Free;
alarmlist.Free;
webbrowser.Free;
inherited destroy;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
tabsheet:TTabSheet2;
begin
tabsheet:=TTabSheet2.create(PageControl1);
tabsheet.Show;
tabsheet.Visible:=true;
tabsheet.PageControl:=PageControl1;
// bindet den Webbrowser an das Tabsheet
tabSheet.webbrowser.ParentWindow:=tabsheet.Handle;
// Webbrowser soll im gesamten TabSheet angezeigt werden
tabsheet.webbrowser.Align:=alClient;
tabsheet.Anchors:=[akLeft,akTop,akRight,akBottom];
tabSheet.webbrowser.Navigate('
www.google.de');
end;
end.