Autor Beitrag
thdoerner
Hält's aus hier
Beiträge: 2

XP
Delphi 5
BeitragVerfasst: Mi 06.07.05 18:37 
Hallo zusammen,

tja, bisher hatte ich alles in diesem Forum gefunden, daß ein Anfänger braucht. Aber nun habe ich ein Problem, daß ich nicht im Forum finden konnte:

Also: Mann stelle sich vor (Pseudocode)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
Label1.Color := clRed;
Label2.Color := clRed;
.
.
Label8.Color := clRed;


Gibt es eine Möglichkeit um das mit einer Schleife zu erledigen? Wie etwa

ausblenden Delphi-Quelltext
1:
2:
3:
4:
for i := 1 to 8 do
begin
  label[i].Color := clRed;
end;


Bekomme das in der Programmierung einfach nicht hin, oder geht das überhaupt?

Für eure Hilfe schonmal vielen Dank im Voraus

mfg
Thomas

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.

_________________
Der Tag hat 24h, und wenn's mal brennt hast ja auch noch die Nacht ;-))
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mi 06.07.05 18:40 
ja gibt es :D

gib mal
Zitat:

fincomponent

ein und drücke auf F1 :wink:
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Mi 06.07.05 18:44 
Ich schätze, fear meinte Suche in: Delphi-Forum, Delphi-Library FINDCOMPONENT...

_________________
JSXGraph
Tilman
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1405
Erhaltene Danke: 51

Win 7, Android
Turbo Delphi, Eclipse
BeitragVerfasst: Mi 06.07.05 18:57 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var n: Integer;
begin
  for n := 1 to 8 do
    begin
      TLabel(findcomponent('label'+IntToStr(n))).Color := clRed;
    end;
end;


Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
thdoerner Threadstarter
Hält's aus hier
Beiträge: 2

XP
Delphi 5
BeitragVerfasst: Mi 06.07.05 19:10 
Also diiiie Hilfe war prompt,

ein großes Danke an alle.

Grüße
Thomas
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mi 06.07.05 19:12 
user profile iconF34r0fTh3D4rk hat folgendes geschrieben:
ja gibt es :D
gib mal
Zitat:

fincomponent

ein und drücke auf F1 :wink:


:arrow:

user profile iconF34r0fTh3D4rk hat folgendes geschrieben:
ja gibt es :D
gib mal
Zitat:

findcomponent

ein und drücke auf F1 :wink:


:tongue:
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Do 07.07.05 17:37 
ist ja gut leute, wir sind hier nicht im NC-Forum :lol:
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Do 07.07.05 18:15 
user profile iconF34r0fTh3D4rk hat folgendes geschrieben:
ist ja gut leute, wir sind hier nicht im NC-Forum :lol:

Das war ein Link... ;) Da macht es eigentlich schon was, wenn ein Buchstabe fehlt... :tongue:
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Do 07.07.05 18:18 
bei mir war es kein link :wink:
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Do 07.07.05 18:38 
Leg unter private z.B. ein Array of Label an. Den Einträgen weist du dann deine Labels zu. z.B.:

ausblenden Delphi-Quelltext
1:
labelArray[1]:=label1;					


Durch die Zuweisung kopierst du nur die Referenz auf das Label, änderungen am Original werden auch im Eintrag des Array sichtbar.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Do 07.07.05 18:57 
user profile iconF34r0fTh3D4rk hat folgendes geschrieben:
bei mir war es kein link :wink:

:rofl: Sorry... Hab das mit einem anderen Post verwechselt... :lol: Da war's ähnlich... ;) Sorry... :tongue: