Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Caption von Form ändern, die mit CreateForm erstellt wurde (https://www.delphipraxis.net/11071-caption-von-form-aendern-die-mit-createform-erstellt-wurde.html)

Yheeky 30. Okt 2003 16:12


Caption von Form ändern, die mit CreateForm erstellt wurde
 
Hi,

mit folgendem Code, schließe ich eine Form, die ich zuvor mit CreateForm erstellt habe:

Code:
Application.FindComponent('Form' + IntToStr(I)).Destroy;
Wie könnte ich nun die Caption von der betroffenden Form ändern? Dies geht nämlich nicht auf diese Weise, weil die Funktion Caption nicht zur Verfügung steht.

Gruß Yheeky

Christian Seehase 30. Okt 2003 16:13

Re: Caption von Form ändern, die mit CreateForm erstellt wur
 
Moin Yheeky,

per Typecast müsste das gehen:

Ein Beispiel:

Delphi-Quellcode:
var
  frm : TForm1;

begin
  frm := (Application.FindComponent('Form1') as TForm1);
if frm <> nil then begin
  frm.Caption := 'Was auch immer';
end;

Yheeky 30. Okt 2003 16:23

Re: Caption von Form ändern, die mit CreateForm erstellt wur
 
Super, danke! Funktioniert!

Gruß Yheeky


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