Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi FindComponent... (https://www.delphipraxis.net/19170-findcomponent.html)

marc.beeh 30. Mär 2004 15:01


FindComponent...
 
Warum bekomme ich bei folgenden Anweisungen bei TCaption... immer "[Fehler] eingabe.pas(231): Record, Objekt oder Klassentyp erforderlich"?

(CP ist ein weiteres Formular; User ist ein Record-Array)

Delphi-Quellcode:
for i := 1 to 15 do
  begin
   TCaption(FindComponent('CP.Edit'+IntToStr(i))).Text := User[i].name;
  end; //for-end

axelf98 30. Mär 2004 15:08

Re: FindComponent...
 
Vielleicht gehts ja so besser:
Delphi-Quellcode:
(Findcomponent('Edit1') as Tedit).Text := 'Hallo';
oder so:
Delphi-Quellcode:
Tedit(Findcomponent('Edit1')).Text := 'Hallo';

marc.beeh 30. Mär 2004 15:12

Re: FindComponent...
 
Danke, die erste Variante scheint zu funktionieren :-D


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