Autor Beitrag
jjturbo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Di 04.10.05 06:56 
Moin Forum,

ich möchte alle Captions der in meiner Anwendung verwendeten Komponenten auflisten(Ich muß eine Sprachumschaltung russisch/deutsch implementieren).
Die Komponentennamen sowie -klassen aufzulisten ist kein Problem. Aber wie greife ich möglichst geschickt in einer Schleife auf die Captions zu? TComponent.Caption gibts ja leider nicht, und einige Kompos haben ja auch keine Caption. Alle verwendeten Klassennamen einzeln abzufragen kann doch nicht die Lösung sein, oder?

Ich hoffe, Ihr könnt mir weiterhelfen.

Danke im voraus, jjturbo

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
Raffo
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 300



BeitragVerfasst: Di 04.10.05 07:27 
In dieser Art:

ausblenden Delphi-Quelltext
1:
2:
3:
for i:=0 to ComponentCount-1 do
    begin
    listbox1.items.add((FindComponent(components[i].name) as TLabel).Caption);
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Di 04.10.05 07:35 
Ok, dann muß ich aber für jede verwendete Klasse eine solche Zeile schreiben.
Mich würde interessieren, wie man das in einer Schleife machen kann, ohne jede Klasse, z.B. TLabel oder TButton einzeln abzufragen...

So gehts ja leider nicht:
ausblenden Delphi-Quelltext
1:
2:
3:
for i := 0 to ComponentCount-1 do begin
  ListBox1.Items.Add(Components[i].Caption);
end;
:?

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Di 04.10.05 08:56 
Morgen,

da kram ich doch glatt mal wieder einen (ok, den einzigen ;)) FAQ-Beitrag von mir raus:
...prüfen, ob ein Object eine bestimmte Eigenschaft besitzt

Gruß,
raziel

_________________
JSXGraph
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Di 04.10.05 12:41 
Das habe ich gesucht.
Danke :D

Gruß aus Russland, jjturbo

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...