Autor Beitrag
Regan
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2157
Erhaltene Danke: 72


Java (Eclipse), Python (Sublimetext 3)
BeitragVerfasst: Do 25.05.06 13:04 
Hallo,
ich habe ein programm geschrieben, in dem man irgendwann mal abgefragt wird ob man das zu öffnende dokument in dem offenen tab oder in einem neuen tab öffnen will. (wie beim mozilla, firefox oder opera) wie kann ich nun ein neues Tab zur Laufzeit erstellen?
ich hab es schon so versucht:

ausblenden Delphi-Quelltext
1:
seite.InsertComponent(TTabSheet);					

wobei "seite" TPageControl ist. aber da kommt immer der fehler.
reference'
ausblenden Quelltext
1:
[Fehler] editor.pas(61): E2010 Inkompatible Typen: 'TComponent' und 'Class					

weiß jemand wie das geht und wie man dann dem tab noch einen Namen gibt und dann dort darauf noch eine RichEdit oder Memo komponente kriegt?
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Do 25.05.06 13:28 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure XY;
var
tab: TTabsheet;
rich: TRichEdit;
begin
tab := TTabSheet.Create(Self);
tab.PageControl := PageControl1;
//hier einstellungen zum Tab vornehmen

//RichEdit auf dem Tabsheet erstellen
rich := TRichEdit.Create(Self);
Rich.parent := tab;
//...
end;


Gruß alias5000

_________________
Programmers never die, they just GOSUB without RETURN
Regan Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2157
Erhaltene Danke: 72


Java (Eclipse), Python (Sublimetext 3)
BeitragVerfasst: Do 25.05.06 13:34 
vielen dank. problem gelöst. ich hatte es vergessen zu erstellen.