Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > OOP
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
  #9  
Antiguo 21-05-2012
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Poder: 38
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola.

Aunque seguramente no lo haga tan claro como roman, con respecto al código, te pongo un ejemplo con un ScrollBox que contiene además del GroupBox un Panel con controles.

Lo podes hacer de este modo:
Código Delphi [-]
var
  i,j: Integer;
begin
  for i:= 0 to ScrollBox1.ControlCount-1 do
  begin
    if ScrollBox1.Controls[i] is TGroupBox then  // Es un GroupBox ?
      with TGroupBox(ScrollBox1.Controls[i]) do  // con el GroupBox hacer
        for j:= 0 to ControlCount-1 do
        begin
          if Controls[j] is TCheckBox then  // Es un CheckBox ?
            TCheckBox(Controls[j]).Checked:= True;
          if Controls[j] is TLabel then  
            ListaDeNombres.Add(TLabel(Controls[j]).Caption);
          if Controls[j] is TRadioButton then  
            TRadioButton(Controls[j]).Checked:= True;
        end;
    if ScrollBox1.Controls[i] is TPanel then  // Es un TPanel ?
      with TPanel(ScrollBox1.Controls[i]) do  // Con el TPanel hacer
        for j:= 0 to ControlCount-1 do
        begin
          if Controls[j] is TEdit then
            TEdit(Controls[j]).Color:= clRed;
          if Controls[j] is TButton then
            TButton(Controls[j]).Caption:= 'Hola';
        end;
  end;
end;
Pero quizá te resulte más entendible así:
Código Delphi [-]
var
  i,j: Integer;
  Gb: TGroupBox;
  Tp: TPanel;
begin
  for i:= 0 to ScrollBox1.ControlCount-1 do
  begin
    if ScrollBox1.Controls[i] is TGroupBox then // Es un GroupBox ?
    begin
      Gb:= TGroupBox(ScrollBox1.Controls[i]);  // Gb es el GroupBox
      for j:= 0 to Gb.ControlCount-1 do
      begin
        if Gb.Controls[j] is TCheckBox then
          TCheckBox(Gb.Controls[j]).Checked:= True;
        if Gb.Controls[j] is TLabel then
          ListaDeNombres.Add(TLabel(Gb.Controls[j]).Caption);
        if Gb.Controls[j] is TRadioButton then
          TRadioButton(Gb.Controls[j]).Checked:= True;
      end;
    end;
    if ScrollBox1.Controls[i] is TPanel then  // Es un TPanel ?
    begin
      Tp:= TPanel(SCrollBox1.Controls[i]);  // Tp es el TPanel
      for j:= 0 to Tp.ControlCount - 1 do
      begin
        if Tp.Controls[j] is TEdit then
          TEdit(Tp.Controls[j]).Color:= clRed;
        if Tp.Controls[j] is TButton then
          TButton(Tp.Controls[j]).Caption:= 'Hola';
      end;
    end;
  end;
end;

TWinControl es la clase base para todos los controles que contienen ventanas (TObject->TPersistent->TComponent->TControl->TWinControl). De TWinControl derivan por ejemplo: TEdit, TPanel, TButton, TComboBox,...

Saludos.
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....

Última edición por ecfisa fecha: 22-05-2012 a las 18:00:32.
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
Pregunta sobre NVL aluser SQL 5 13-11-2008 23:59:00
Consulta sencilla sobre ms access fybeyancourt Tablas planas 2 05-03-2007 22:51:58
Pregunta sobre BDE JorgeBec Conexión con bases de datos 1 18-03-2005 15:53:02
pregunta sencilla valentine Varios 7 17-06-2004 21:17:40
Pregunta Sencilla jorge_mosquera Gráficos 1 19-03-2004 03:39:20


La franja horaria es GMT +2. Ahora son las 22:44:03.


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