Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi ListBox - Items.Add oben? (https://www.delphipraxis.net/96754-listbox-items-add-oben.html)

Tommy1988 30. Jul 2007 13:38


ListBox - Items.Add oben?
 
Hallo, wenn man ListBox1.Items.Add(String) ausführt, wird ja der Text des Strings in die ListBix geschrieben, aber UNTEN. Ist es irgentwie möglich das umgekehrt zu machen?

Also so, dass der String OBEN statt unten in die Listbox geschrieben wird?

mkinzler 30. Jul 2007 13:39

Re: ListBox - Items.Add oben?
 
.Insert()

Tommy1988 30. Jul 2007 13:43

Re: ListBox - Items.Add oben?
 
So wird sie ans ende geschrieben
ListBox1.Items.Add('Text');

So an 2. Stelle
ListBox1.Items.Insert(1,'Text');

Erste Zeile löschen
ListBox1.Items.Delete(0);

2. Zeile ersetzen
ListBox1.Items[2] := '3 Zeile ersetzt';


Zu 2. Beispiel:
SO bewirkt
ListBox1.Items.Insert(0,'Text');
dass der Text ganz oben hingeschrieben wird, richtig?

Weil die Zählung fängt ja bei 0 an.


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:39 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz