Autor Beitrag
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 14.04.06 22:09 
Hallo,

ich erstelle zur Laufzeit einen Button:
ausblenden Delphi-Quelltext
1:
blubb:=TButton.Create(problem);					

Der Parameter soll sein: "AOwner:TComponent". Was muss ich mir darunter vorstellen? Was bedeutet in diesem Fall der Begriff "Owner"?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 14.04.06 22:20 
AOwner ist einfach der name des Parameters. Mit diesem Parameter übergibst du den zu setzenden Owner der neu zu erzeugenden Kompoenente, was auch eine Komponente is (TComponent). Dadurch wird die Lebenszeit der neuen Komponente an die des Owners gebunden.D.H wird er zerstört, die neue Kompo auch.

_________________
Markus Kinzler.
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Fr 14.04.06 23:06 
In deinem Fall suchst du bestimmt als Owner Self ;)


greetz

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.