Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual 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 Dev Shed Forums Sponsor:
  #1  
Old April 30th, 2003, 04:50 PM
Mustang Mustang is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Vancouver, BC, Canada
Posts: 1 Mustang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Moving Items Up/Down in List Box w/VB

There is another thread in the javascript section with almost the same title, so what I am wondering is if there is a VB version of it. The thread id is

URL

Any help would be greatly appreciated

Reply With Quote
  #2  
Old April 30th, 2003, 08:34 PM
defjamninja defjamninja is offline
Overly white
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Fresno, CA
Posts: 83 defjamninja User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
I wrote this in just a few minutes here in class so I'm sure I missed a bug or two but you can maybe use this as a general idea. I've included a simple example if you want to see it in action.

Code:
Private Sub Add2List(ListSrc As ListBox, ListDst As ListBox)
    With ListSrc
        For intI = 0 To .ListCount - 1
            If .Selected(intI) = True Then
                ListDst.AddItem (.List(intI))
                .RemoveItem (intI)
                Exit For
            End If
        Next
    End With
End Sub

Private Sub MoveUpList(lstSrc As ListBox)
    Dim intI As Integer
    Dim strTemp As String
    With lstSrc
        For intI = 0 To .ListCount - 1
            If .Selected(intI) = True And .ListIndex <> 0 Then
                strTemp = .List(intI)
                .RemoveItem intI
                .AddItem strTemp, intI - 1
                Exit For
            End If
        Next
    End With
End Sub
Attached Files
File Type: zip list boxen.zip (1.3 KB, 798 views)

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Moving Items Up/Down in List Box w/VB


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 5 hosted by Hostway
Stay green...Green IT