Solved

Elist error index out of range

Posted on 2003-10-24
4
427 Views
Last Modified: 2010-08-05
Hi,

    i have a problem with a listbox that has the property multiple select set to
    true and sort set to true. coz everytime i have to remove multiple items or
    one item it will display an error elist errot. can you help me?
0
Comment
Question by:therooster
  • 2
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 250 total points
ID: 9612966
remove from behind to front like

for i := listbox1.items.count - 1 downto 0 do
  if listbox1.items[i].selected then
     listbox1.items.delete(i);

meikl ;-)
0
 
LVL 17

Expert Comment

by:geobul
ID: 9613320
Exactly. Just a little correction:

for i := listbox1.items.count - 1 downto 0 do
  if listbox1.selected[i] then
     listbox1.items.delete(i);

If this answers your question then accept kretzschmar's comment as answer !!!

Regards, Geo
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9613386
thanks for the correction, geo,
usual it was just from head,
as often as last time

meikl ;-)
0
 
LVL 17

Expert Comment

by:geobul
ID: 9613423
No problem, meikl :-)
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 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