![]() |
...und man das eigene Array umbenennen kann. Wen du mit FindComponent arbeitest, wird das nachher ein sehr schöner Spass, die Variabelnamen zu ändern!
|
hi,
bin j auch noch ein bissel lernbedürftig, hab bisher auch wie brüggendiek das ganze mir array gemacht, aber wie funktioniert denn so eine "FindComponent" genau?? also vielleicht ein einfacher Beispiel-source mit erklärung, soweit das keine umstände macht! danke schonmal ciao haegar |
Du bist schon a bisserl Faul?! :twisted: :twisted:
1. Suche benutzen, dies wurde schon sehr oft besprochen. 2. Sagt die OH folgendes dazu:
Delphi-Quellcode:
Indicates whether a given component is owned by the component.
function FindComponent(const AName: string): TComponent; Description FindComponent returns the component in the Components property array with the name that matches the string in the AName parameter. Use FindComponent to determine whether a given component is owned by another.
Delphi-Quellcode:
Grüsse, Daniel :hi:
The following example creates 20 edit boxes, using FindComponent with the edit box name to access each newly created edit box.
procedure TForm1.Button1Click(Sender: TObject); var i: Integer; const NamePrefix = 'MyEdit'; begin for i := 1 to 20 do begin TEdit.Create(Self).Name := NamePrefix + IntToStr(i); with TEdit(FindComponent(NamePrefix + IntToStr(i))) do begin Left := 10; Top := i * 20; Parent := self; end; end; end; |
ja hast ja recht, sry, werd das nächste mal erst inne hilfe schauen ;)
trotzdem danke |
Moin Nailor,
Zitat:
Das hab' ich nicht verstanden. |
Moin Christian,
Zitat:
Wenn man nun die Namen ändert, so hat man natürlcih keine Chanche mehr mit FindComponent('Name' + IntToStr(i)); Ich denke das Er dies gemeint hat. So hab ich das verstanden. Grüsse, Daniel :hi: |
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:32 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