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:
  #1  
Old December 26th, 2006, 06:53 PM
grad grad is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Posts: 110 grad User rank is Lance Corporal (50 - 100 Reputation Level)grad User rank is Lance Corporal (50 - 100 Reputation Level)grad User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 6 h 39 m 56 sec
Reputation Power: 3
Multiselect listbox

how can you remove the selected itemS in a mulitselect listbox using VB 6.0? thanks

Reply With Quote
  #2  
Old December 26th, 2006, 07:24 PM
Alias-Zero Alias-Zero is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Location: localhost
Posts: 40 Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 14 h 44 m 12 sec
Reputation Power: 4
Send a message via ICQ to Alias-Zero Send a message via AIM to Alias-Zero Send a message via MSN to Alias-Zero Send a message via Yahoo to Alias-Zero
Quote:
Originally Posted by grad
how can you remove the selected itemS in a mulitselect listbox using VB 6.0? thanks


You could loop through the entire list box and do this...

Code:
If List1.Selected(i) = True Then
List1.RemoveItem (i)
End If


Hope that helps,
-Alias
Comments on this post
Zath agrees!

Reply With Quote
  #3  
Old December 26th, 2006, 07:30 PM
grad grad is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Posts: 110 grad User rank is Lance Corporal (50 - 100 Reputation Level)grad User rank is Lance Corporal (50 - 100 Reputation Level)grad User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 6 h 39 m 56 sec
Reputation Power: 3
i wrote it like this but its giving an error...invalid property array index.....?? =(

For i = 0 To courselstbx.ListCount - 1
If courselstbx.Selected(i) = True Then
courselstbx.RemoveItem (i)

End If
Next i

Reply With Quote
  #4  
Old December 26th, 2006, 07:37 PM
grad grad is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Posts: 110 grad User rank is Lance Corporal (50 - 100 Reputation Level)grad User rank is Lance Corporal (50 - 100 Reputation Level)grad User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 6 h 39 m 56 sec
Reputation Power: 3
ok i wrote it in reverse order and for some reason its working now...

For i = courselstbx.ListCount - 1 To 0 Step -1
If courselstbx.Selected(i) = True Then
courselstbx.RemoveItem (i)

End If
Next i

=)

Reply With Quote
  #5  
Old December 27th, 2006, 03:58 AM
Alias-Zero Alias-Zero is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Location: localhost
Posts: 40 Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 14 h 44 m 12 sec
Reputation Power: 4
Send a message via ICQ to Alias-Zero Send a message via AIM to Alias-Zero Send a message via MSN to Alias-Zero Send a message via Yahoo to Alias-Zero
Glad to hear I could help.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Multiselect 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



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT