Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Elist error index out of range

Posted on 2003-10-24
4
Medium Priority
?
449 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
[X]
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
4 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 1000 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

730 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