Autor Beitrag
AuronX
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: So 22.08.04 15:25 
Hallo,

ich wollte wissen ob es möglich ist, dass ich bespielsweise Label oder auch Edit-Komponenten auch in folgender Form ansprechen kann:

n:=1.
edit(n).text:='Hallo';

Also das soll so aussehen, dass ich bei einer Zuweisung von Labeln oder Edit-Feldern, nicht alles einzeln ansprechen muss.

Danke für eure Hilfe
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: So 22.08.04 16:16 
Hallo

such mal nach Suche in: Delphi-Forum, Delphi-Library FINDCOMPONENT

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
Elite
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 22.08.04 16:43 
Ok, ich bin mal so freundlich:
Angenommen du hast 20 Label mit den Namen Label1, Label2 ... Label20, dann kannste mit folgendem Code die Captions aller Labels ändern.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
...
var loop: integer;
begin
 for loop := 1 to 20 do
  (FindComponent('Label' + inttostr(loop)) as TLabel).Caption := 'Caption geändert.';
end;
AuronX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: So 22.08.04 18:15 
Alles klärchen, Danke für die Antwort.