Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old December 14th, 2003, 09:12 PM
jfg jfg is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 3 jfg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
VB ListBox

What is the code for deleting items from the listbox one at a time
during runtime? When I use Object.Removeitem Index, It only removes the first item from the list. I want it to remove the selected item from the list only.

Last edited by jfg : December 18th, 2003 at 11:56 AM.

Reply With Quote
  #2  
Old December 15th, 2003, 01:05 AM
Stev Stev is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Queensland, Australia
Posts: 256 Stev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 53 sec
Reputation Power: 5
object.RemoveItem index

Reply With Quote
  #3  
Old December 18th, 2003, 11:57 AM
jfg jfg is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 3 jfg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
VB ListBox

Thank you for replying.

When I use Object.Removeitem Index, It only removes the first item from the list. I want it to remove the selected item from the list only.

Reply With Quote
  #4  
Old December 18th, 2003, 02:11 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,751 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 3 h 32 m 46 sec
Reputation Power: 443
Code:
Private Sub Form_Load()
    ListView1.ListItems.Add , , "TEST"
    ListView1.ListItems.Add , , "TEST2"   
End Sub

Private Sub cmdButton_Click()
    Dim item As ListItem
    Dim i As Integer
    
    For i = 1 To ListView1.ListItems.Count
        If (ListView1.ListItems(i).Selected) Then
            ListView1.ListItems.Remove (i)
            Exit For
        End If
    Next i
End Sub

Reply With Quote
  #5  
Old December 19th, 2003, 01:04 AM
jfg jfg is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 3 jfg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
VB ListBox

Thank you for replying

It worked!!!!!!!!!!!!!!!!!!!

Thanks again

Reply With Quote
  #6  
Old December 30th, 2003, 08:26 AM
wycliffeo wycliffeo is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: kenya
Posts: 1 wycliffeo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you also for helping your friend

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > VB ListBox


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway