Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 14-11-2012
cloayza cloayza is offline
Miembro
 
Registrado: may 2003
Ubicación: San Pedro de la Paz, Chile
Posts: 947
Poder: 25
cloayza Tiene un aura espectacularcloayza Tiene un aura espectacular
Para estos menesteres me inclino por el uso de la RTTI

Código Delphi [-]
uses TypInfo;
...

function ExistProperty(AComp: TComponent; APropName: String):Boolean;  
var                                                                    
  PropInfo: PPropInfo;                                                 
begin                                                                  
     PropInfo := GetPropInfo(AComp.ClassInfo, APropName);              
     Result:=Assigned(PropInfo);                                       
end;                                                                   

procedure SetBooleanProperty(AComp: TComponent; APropName: String; AValue: Boolean);  
var                                                                                   
  PropInfo: PPropInfo;                                                                
begin                                                                                 
     PropInfo := GetPropInfo(AComp.ClassInfo, APropName);                             
     if PropInfo <> nil then                                                          
     begin                                                                            
          if PropInfo^.PropType^.Kind = tkEnumeration then                            
            SetOrdProp(AComp, PropInfo, Integer(AValue));                             
     end;                                                                             
end;                                                                                  

procedure TForm1.Button2Click(Sender: TObject);
var
   Control : Array[1..6] of TComponent;
   i : Integer;

begin

   // El arreglo contiene los nombres de los componentes a gestionar (Propiedad Name)
   Control[1] := Label1;
   Control[2] := Label2;
   Control[3] := Label3;
   Control[4] := Edit1;
   Control[5] := Edit2;
   Control[6] := Edit3;

   for i := 1 to 6 do
       if ExistProperty(Control[1],'Enabled') then
          SetBooleanProperty(Control[1],'Enabled', True);  
end;
Saludos cordiales
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
valores diferentes en array anubis Varios 6 17-04-2007 09:47:39
Imprimir diferentes tipos de etiqueta Lizeth Impresión 0 07-09-2006 03:27:05
Uso de diferentes tipos de URLs en aplicaciones Web dec PHP 38 08-05-2006 09:07:54
problema con un array de tipos aram2r OOP 5 08-06-2005 09:54:28
Unión con diferentes tipos de dato Kafu Firebird e Interbase 2 09-02-2004 13:20:45


La franja horaria es GMT +2. Ahora son las 23:16:40.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi