Buenas!!
Aquí te pego un trozo de codigo de un codigo fuente de un codigo fuente escrito por manulon sobre un hospital. Creo que puedes encontrarlo en la seccion ejemplos de esta pagina..
Código Delphi
[-]
procedure TForm3.InsertarClick(Sender: TObject);
var
Ficha: TPaciente; Paciente: TListItem; i: Integer; begin
Ficha.Nombre := edNombre.Text;
Ficha.Edad := edEdad.Text;
Ficha.Telefono := edTelefono.Text;
with edNombre, edEdad, edTelefono do
begin
Close; Paciente := Form2.Lista.Items.Add; Paciente.Caption := Ficha.Nombre; i := Form2.Lista.Items.Count-1; Form2.Lista.Items.Item[i].SubItems.Add(Ficha.Edad); Form2.Lista.Items.Item[i].SubItems.Add(Ficha.Telefono); Form2.Lista.Items.Item[i].SubItems.Add(IntToStr(i+1)); estado }
end;
end;
Saludos!