Ver Mensaje Individual
  #8  
Antiguo 04-07-2013
Avatar de nlsgarcia
[nlsgarcia] nlsgarcia is offline
Miembro Premium
 
Registrado: feb 2007
Ubicación: Caracas, Venezuela
Posts: 2.206
Reputación: 21
nlsgarcia Tiene un aura espectacularnlsgarcia Tiene un aura espectacular
avechuche,

Cita:
Empezado por avechuche
...agrego los valores correspondientes a las columnas de mi ListView...El problema esta que siempre me agrega la primer linea del ".txt"...
Revisa este código:
Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var
   i,j : Integer;
   StrList : TStringList;

begin

   ListView1.ViewStyle := vsReport;
   ListView1.Clear;

   with TStringList.Create do
   try
      LoadFromFile('ARCHIVO.TXT');
      StrList := TStringList.Create;
      for i := 0 to Count-1 do
      begin
         ExtractStrings(['|'], [], PChar(Strings[i]), StrList);
         with ListView1.Items.Add do
         begin
            SubItems.Add(StrList.Strings[0]);
            SubItems.Add(StrList.Strings[1]);
            StrList.Clear;
         end;
      end;
      StrList.Free;
   finally
      Free;
   end;

end;
El código anterior es una variante del sugerido en el Msg #5 adaptada a un control TListView.

Espero sea útil

Nelson.
Responder Con Cita