[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 328
  • Last Modified:

Find & Delete String in Listbox

How do I find and delete a string in a listbox?  The delete method needs an integer, so how do I match the Integer to the String?
0
d4jaj1
Asked:
d4jaj1
1 Solution
 
MikeP090797Commented:
First you list throught the list to find the string and get it's index, and then you delete it using he index you've got
0
 
d4jaj1Author Commented:
I know that - what I don't know is how to find a string literal in the listbox?
0
 
philipleighsCommented:
If your list box is called ListBox1 and you want to delete an item called "delete me" from the list, you can do this:

  var Index: Integer;
begin
Index := ListBox1.Items.IndexOf('delete me');
if Index > -1 then
    ListBox1.Items.Delete(Index);
end;

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now