Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Tedit in Tpanel (https://www.delphipraxis.net/9193-tedit-tpanel.html)

Nimoee 20. Sep 2003 09:34


Tedit in Tpanel
 
Hallo,

ich möchte eine Komponente erzeugen, mit tpanel als Rahmen und in diesem Panel ein Editfeld mit Tlabel als Text davor.
Mein Problem:
In die Create Methode von Tpanel hab ich

Delphi-Quellcode:
constructor Tkombiedit.Create(AOwner: TComponent);
begin
  inherited;
  s:=tedit.create(self);
  s.parent:=parent;
  s.left:=10;
  s.top:=10;
  s.height:=20;
  s.width:=100;
end;
geschrieben.
Es klappt jedoch nicht. Kann mir jemand helfen?
Was ist da falsch?

nimoee

Christian Seehase 20. Sep 2003 11:58

Re: Tedit in Tpanel
 
Moin Nimoee,

Du hast zwar nicht dazugeschrieben, was nicht funktioniert, aber ich rate mal:

Durch diese Zeile

Delphi-Quellcode:
s.parent:=parent;
wird der Parent des Panels als Parent des Edits gesetzt.
Das Editfeld wird dadurch relativ zum Parent des Panels angezeigt, und nicht relativ zum Panel.

So

Delphi-Quellcode:
s.parent:=self;
sollte es eigentlich funktionieren.


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:03 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