Elist error index out of range

Posted on 2003-10-24
Last Modified: 2010-08-05

    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?
Question by:therooster
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 27

Accepted Solution

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

meikl ;-)
LVL 17

Expert Comment

ID: 9613320
Exactly. Just a little correction:

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

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

Regards, Geo
LVL 27

Expert Comment

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

meikl ;-)
LVL 17

Expert Comment

ID: 9613423
No problem, meikl :-)

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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
drawing animated level bar based on numbers 3 121
creating threads in delphi 1 202
DBCtrlGrid, Delphi, Scroll 8 86
Firemonkey Tcameracomponent resultion 1 48
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

738 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