Solved

Find & Delete String in Listbox

Posted on 1998-01-26
3
305 Views
Last Modified: 2010-08-05
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
Comment
Question by:d4jaj1
3 Comments
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1357610
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
 
LVL 3

Author Comment

by:d4jaj1
ID: 1357611
I know that - what I don't know is how to find a string literal in the listbox?
0
 
LVL 3

Accepted Solution

by:
philipleighs earned 10 total points
ID: 1357612
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
error 1.1 400 Bad request idhttp delphi 18 200
find a node in VST 2 78
How to convert memory stream to PDF file 6 171
Dynamically Created Query 3 69
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question