Ver Mensaje Individual
  #1  
Antiguo 19-03-2009
maurici0 maurici0 is offline
Miembro
 
Registrado: feb 2009
Posts: 17
Reputación: 0
maurici0 Va por buen camino
Exclamation Convertir Texto a String

Resuelto

Hola a todos me ha sugido una duda.

Hay alguna forma de convertir un texto en una variable u objeto?, ejemplo:
Código Delphi [-]
var
lbl : String;
begin
lbl:='Label1';
 
with lbl do
  begin
  Enabled:=FALSE;
  end;

Quiero hacer esto, ya que para validar campos es la muerte hacerlos manualemnte :s (ya que son mas de 500 campos).

O como puedo habilitar varios labels con un for o algo asi?
Solucion:
Gracias ContraVeneno.
Solucion 1:
Código Delphi [-]
 for  i:=componentcount-1 downto 0 do begin
      if Components[i] is TLabel then begin
           TLabel(Components[i]).Enabled:= True;
      end; //fin if
  end; //fin for


Solucion2:
Código Delphi [-]
 for  i:=componentcount-1 downto 0 do begin
      if (Components[i] is TLabel) and (TLabel(Components[i]).Tag in [1..50])  then begin
           TLabel(Components[i]).Enabled:= True;
      end; //fin if
  end; //fin for

Última edición por maurici0 fecha: 19-03-2009 a las 18:58:04. Razón: Mas explicación
Responder Con Cita