gruß,
probier's mal so
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
| ListBox.Items.Delete(ListBox.Items.IndexOf('Hack Gott')); ... var i: integer; ... for i := ListBox.Items.Count-1 downto 0 do if ListBox.Items[i] = 'Hack Gott' then ListBox.Items.Delete(i); wenn nur das erste Vorkommnis gelöscht werden soll |
mfg
GSE
[edit] Mist zu langsam, aber IndexOf gibt bei Nichtvorhandensein "-1" zurück und erzeugt mit Delete dann eien Exception, also vorher besser auf "-1" prüfen.[/edit]
_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)