![]() |
Create von TLabel funktioniert nicht
Hallo,
habe heute folgenden Code ausprobiert, doch leider wird mir auf dem definierten Form das Label nicht angezeigt :-( Wisst Ihr warum?
Delphi-Quellcode:
Danke!
var
Status:TForm; Progress:TJvXPProgressBar; anzeige:TLabel; begin status:=Tform.Create(nil); with status do begin Position:=poScreencenter; width:=385; Height:=89; color:=clwhite; Formstyle:=fsstayontop; BorderStyle:=bstoolwindow; BorderIcons:=[]; show; end; anzeige:=Tlabel.create(Status); with anzeige do begin Left:=8; Top:=9; Caption:='Bitte warten... Vorgang wird initialisiert'; show; anzeige.Repaint; end; |
Re: Create von TLabel funktioniert nicht
setze mal noch das Form als parent
Gruss Kh |
Re: Create von TLabel funktioniert nicht
Hi,
du musst das Parent setzen, damit Delphi weiß, auf welcher Komponente das Label platziert werden soll:
Delphi-Quellcode:
Grüße, Matze
anzeige.Parent := Form1;
Edit: zu langsam ... |
Re: Create von TLabel funktioniert nicht
Danke!
Hat funktioniert ;-) Nun habe ich aber doch eine Frage... ich habe doch oben schon das Label meinem Form zugewiesen oder? Also mit:
Delphi-Quellcode:
Warum muss ich das dann mit dem Parent noch machen... wo liegt der Unterschied?
Anzeige:=TLabel.create(Status);
Danke! |
Re: Create von TLabel funktioniert nicht
Ich bin mir nicht ganz sicher, aber der Owner sagt glaub nur aus, welcher Komponente das Label zugeordnet ist, was das Freigeben betrifft. Du musst das Label theoretisch nicht manuell freigeben, da zusammen mit dem Owner bzw. deinem Formular freigegeben wird.
Grüße, Matze |
Re: Create von TLabel funktioniert nicht
da hat du das label nur erzeugt, aber nicht definiert wo es angezeigt werden soll.
Gruss KH |
Re: Create von TLabel funktioniert nicht
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:54 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz