Autor Beitrag
BlackHole_NK
Hält's aus hier
Beiträge: 6


D7 Ent
BeitragVerfasst: Fr 26.08.05 11:38 
Hallo!

Wie kann man z.B. Labelx (mit Labelx.Tag=y) ansprechen, wenn ich nur die Nummer des Tags habe?

Danke schon mal im Voraus für die Antwort.


Moderiert von user profile iconKlabautermann: Topic aus Sonstiges verschoben am Fr 26.08.2005 um 12:44
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Fr 26.08.05 11:42 
Lauf durch die Components-Liste des Steuerelementes durch, welches die Komponenten enthält und prüf bei jeder Komponente, ob der Tag passt.

_________________
Bravery calls my name in the sound of the wind in the night...
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Fr 26.08.05 11:42 
Moin!

Das hängt von einer "geeigneten" und eindeutigen Wahl für "y" ab. :wink:

cu
Narses
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 26.08.05 11:44 
Also in etwa so:
ausblenden Delphi-Quelltext
1:
2:
3:
for i:=0 to form1.ComponentCount - 1 do
  if form1.Components[i].Tag = 5 then
    showmessage(form1.Components[i].Name);

_________________
We are, we were and will not be.
BlackHole_NK Threadstarter
Hält's aus hier
Beiträge: 6


D7 Ent
BeitragVerfasst: Fr 26.08.05 11:47 
Hm.
Das war schnell ;)

Dankeschön.
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Fr 26.08.05 11:51 
Siehe auch FindComponent, falls der Name des Labels bekannt ist. Wenn du die Labels entsprechend benennst, kannst du dir die Tags sparen.