Solved

Elist error index out of range

Posted on 2003-10-24
4
422 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
Comment Utility
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
Comment Utility
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
Comment Utility
thanks for the correction, geo,
usual it was just from head,
as often as last time

meikl ;-)
0
 
LVL 17

Expert Comment

by:geobul
Comment Utility
No problem, meikl :-)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now