Results 1 to 5 of 5

Thread: Move checked items to top of listbox. (Resolved)

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    154

    Resolved Move checked items to top of listbox. (Resolved)

    Hey All,

    Let's say I have a listbox (style = 1 - checkbox) with the
    following code...

    Code:
    Private Sub Form_Load()
        List1.AddItem "apple", (0)
        List1.AddItem "orange", (1)
        List1.AddItem "banana", (2)
        List1.AddItem "grape", (3)
        List1.AddItem "lime", (4)
        List1.AddItem "lemon", (5)
    End Sub
    Now, let's say I select (check) three of the items in the listbox.
    Can someone please tell me how I can move those three items
    to the top of the list, when I click a button.

    I kind of figured that I will need to loop through the list, but I
    can't seem to get anything to work.

    Thanks in advance for any help,
    Ron
    Last edited by rdcody; Oct 5th, 2004 at 04:18 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width