Ver Mensaje Individual
  #2  
Antiguo 28-10-2004
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.310
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 aromero
...alguien me podría explicar como manipulo los objetos insertados en un TList....
A ver si con un ejemplillo te aclaras:

Código Delphi [-]
var
  L:TList;
  Edit:TEdit;
  Index:Integer;
  E:TEdit;
begin
  // Crear la lista
  L := TList.Create();
  // Crear un objeto (un edit, por ejemplo)
  Edit := TEdit.Create(Self);
  Edit.Name := 'Edit1';
  // Añadirlo a la lista
  Index := L.Add(Edit);
  // Crear un segundo objeto
  Edit := TEdit.Create(Self);
  Edit.Name := 'Edit2';
  // Añadirlo a la lista
  Index := L.Add(Edit);
  // Obtener el primer objeto
  E := L.Items[0];
  E.Text := 'primer edit';
  // Objetener el segundo
  E := L.Items[1];
  E.Text := 'este es el segundo edit';
 
  // Para destruir yo utilizo un for para destruir todos los 
  // objetos y luego libero la lista
  ...
Si hay alguna parte que no entiendes, ya dirás...
__________________
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