![]() |
String in ListBox einfügen ohne Duplikate ?
Hallo
ich möchte Strings in ListBox einfügen. Es soll aber keine Duplikate Ich muss zuerst nach dem String in ListBox suchen und wenn das Ergebnis = 0 then
Delphi-Quellcode:
ListBox1.Items.Add('string')
else ListBox1.Items.Add('string'+IntToStr(1)); // einen anderen namen |
Re: String in ListBox einfügen ohne Duplikate ?
Guck dir mal Listbox.items.indexof(aString) an.
Ich würde das so machen
Delphi-Quellcode:
If Listbox.items.indexof(Teststring) < 0 then //teststring ist nicht in Listbox //mache irgendetwas else //teststring ist in Listbox //mache etwas anderes |
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:41 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz