Solved

How do i Remove An Item from listbox this way !!

Posted on 2008-10-15
2
154 Views
Last Modified: 2012-05-05
All i am trying to do is I Have a listbox and  i have Room Chat Users in it.. now when user leave the room i want him out of listbox too so for that i use  list1.removeitem list1.listindex     but list1.listindex wont work because the listindex isnt selected as current user :-"
0
Comment
Question by:BILAL69
2 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
Comment Utility
If you don't already know the index of the item that you want to remove, you will have to go through the list and look for the item that matches the particular name.
For i = 1 To List1.ListCount - 1

    If List1.List(i) = "PlayerName" Then

        List1.RemoveItem i

        Exit For

    End If

Next i

Open in new window

0
 
LVL 2

Author Closing Comment

by:BILAL69
Comment Utility
thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

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

5 Experts available now in Live!

Get 1:1 Help Now