Autor Beitrag
teamrocket0
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 177
Erhaltene Danke: 1

Win ME, Win XP, Win 7, Win 10
Delphi 7, 10.2 Tokyo
BeitragVerfasst: Di 06.03.07 22:16 
Moin!

Kleine Frage. Wie kann ich die Einträge einer Listbox (Anzahl der Einträge ist unterschiedlich) in einem Memo hinzufügen (Im Memo kann schon was drin stehen)

Für einen Tipp wäe ich dankbar!
Benjie
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55

Win 98 SE / Win XP / xubuntu Linux / Mac OS 9.2
D6 Enterprise
BeitragVerfasst: Di 06.03.07 22:17 
Hallo!

Du kannst ganz einfach eine Schleife durchlaufen lassen:

ausblenden Delphi-Quelltext
1:
2:
for i:= 0 to listbox1.items.count-1 DO
   memo1.lines.add(Listbox1.items[i]);


i ist dann eine integer var!
teamrocket0 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 177
Erhaltene Danke: 1

Win ME, Win XP, Win 7, Win 10
Delphi 7, 10.2 Tokyo
BeitragVerfasst: Di 06.03.07 22:23 
Super. Vielen Dank.

Funktioniert hervorragend!
:zustimm:
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Di 06.03.07 23:51 
Hallo,

eine Schleife ist nicht erforderlich:
ausblenden Delphi-Quelltext
1:
Memo1.Lines.AddStrings(ListBox1.Items);					

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
teamrocket0 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 177
Erhaltene Danke: 1

Win ME, Win XP, Win 7, Win 10
Delphi 7, 10.2 Tokyo
BeitragVerfasst: Mi 07.03.07 22:30 
Danke.
Das geht natürlich auch ganz gut!