Autor Beitrag
Moritz M.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: Mi 09.10.02 18:49 
Hi Leute

Ich hab dazu gesucht aber nichts gefunden(vielleicht bin ich einfach zu dumm...) deshalb stell ich nun die Frage:

Wie kann ich einen Eintrag einer ListBox, wenn ich die Nummer mit listbox.Itemindex weiß, ändern bzw. ermitteln?

cu

onz
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 09.10.02 19:08 
Einmal so:
ausblenden Quelltext
1:
2:
3:
4:
If ListBox1.ItemIndex > -1 Then
  Str := ListBox1.Items [ListBox1.ItemIndex];
Else
  Str := '';

und zum ändern so:
ausblenden Quelltext
1:
2:
If ListBox1.ItemIndex > -1 Then
  ListBox1.Items [ListBox1.ItemIndex] := 'AUQ.de!';

Gruß
Chatfix
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: Mi 09.10.02 19:10 
also auslesen und ändern kannst du folgende eigenschaft:

ausblenden Quelltext
1:
listbox1.Items.Strings[INDEX]:='Dein String';					

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce
Chatfix
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: Mi 09.10.02 19:11 
wieder jmd schneller :evil:

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce
Moritz M. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: Mi 09.10.02 19:49 
Titel: Hi
Müsst euch ja nicht zanken!

Danke an euch beide für eure Hilfe :D

cu

Onz