Ver Mensaje Individual
  #4  
Antiguo 14-01-2005
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - Espańa
Posts: 18.289
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Cita:
Empezado por dmguridi
Mi ejemplo, en que version de Delphi lo probaste?
Delphi 6.

Código Delphi [-]
 procedure TForm1.Button3Click(Sender: TObject);
 var
   i:Integer;
 begin
   for i := Form1.ComponentCount - 1 downto 0 do
     if Form1.Components[i].ClassName = 'TLabel' then
       (Form1.Components[i] As TLabel).Caption := (Form1.Components[i] As TLabel).Caption + '-a'
     else if Form1.Components[i].ClassName = 'TMenuItem' then
       (Form1.Components[i] As TMenuItem).Caption := (Form1.Components[i] As TMenuItem).Caption + '-a'
     else if Form1.Components[i].ClassName = 'TTabSheet' then
       (Form1.Components[i] As TTabSheet).Caption := (Form1.Components[i] As TTabSheet).Caption + '-a'
     else if Form1.Components[i].ClassName = 'TButton' then
       (Form1.Components[i] As TButton).Caption := (Form1.Components[i] As TButton).Caption + '-a';
 end;

...y funcionó OK.
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita