Solved

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

Posted on 2008-10-15
2
160 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
[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 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 22723793
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
ID: 31506413
thanks
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

751 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