Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   OOP (https://www.clubdelphi.com/foros/forumdisplay.php?f=5)
-   -   Convertir items de ListBox a String (https://www.clubdelphi.com/foros/showthread.php?t=61820)

j_flores3000 23-11-2008 21:32:20

Convertir items de ListBox a String
 
Bueno necesito hacer esto, pasarlo a un edit o simplemente guardar todos los items en una variable string. se puede hacer?

marcoszorrilla 23-11-2008 21:41:24

Prueba esto:

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
Var
n:Integer;
begin
 for n:=0 to Listbox1.Items.Count -1 do
 begin
 Edit1.Text:=Edit1.Text+listbox1.Items[n]+' ';
 end;

end;

Un Saludo.

coso 23-11-2008 23:52:03

...o bien

Código Delphi [-]
Edit1.Text := ListBox1.Items.Text;
// ... o ...
Edit1.Text := ListBox1.Items.CommaText;

j_flores3000 24-11-2008 00:03:45

Muchas gracias a los dos. Se puede dar por solucionado el tema! :)


La franja horaria es GMT +2. Ahora son las 12:43:24.

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