Autor Beitrag
Gerhard
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: So 28.09.03 18:24 
Hi,

wie kann man meine Zeile (Item) aus einer ListBox einer String-Variablen zuorden?

Danke für Hinweise

Gerhard


Moderiert von user profile icontommie-lie: Topic verschoben
cbs
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 207
Erhaltene Danke: 1



BeitragVerfasst: So 28.09.03 18:38 
huhu

mit

ausblenden Delphi-Quelltext
1:
listbox1.items[index]					


kannst du auf jede zeile zugreifen. index fängt dabei mit 0 an! also die zeile 1 hat den index 0 usw

zuweisen dann halt so

ausblenden Delphi-Quelltext
1:
stringvar:= listbox1.items[2];					


stringvar hat dann den inhalt von zeile 3
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 28.09.03 18:48 
Ergänzung: die Anzahl der Items in einer Listbox bekommst Du mit Items.Count. Da der Index aber - wie bereits gesagt - bei Null beginnt, ist der höchste Index, der in einer Listbox vorkommt Items.Count - 1.

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Gerhard Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: So 28.09.03 19:39 
Danke
Gerhard