Results 1 to 18 of 18

Thread: [RESOLVED] Sorting a ListBox by ItemData?

Hybrid View

  1. #1
    PowerPoster Ellis Dee's Avatar
    Join Date
    Mar 2007
    Location
    New England
    Posts
    3,530

    Re: Sorting a ListBox by ItemData?

    Does that sorting algorithm have a name or did you make it up from scratch?
    Last edited by Ellis Dee; Oct 20th, 2008 at 07:31 PM.

  2. #2
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Sorting a ListBox by ItemData?

    Quote Originally Posted by Ellis Dee
    Does that sorting algorithm have a name or did you make it up from scratch?
    I got the basic code from someone named MrMac awhile back (not sure if he is on this forum or not),

    Code:
        For i = 0 To UBound(d) - 1
            For j = i + 1 To UBound(d) - 1
                If d(i) > d(j) Then
                    Dtmp = d(j)
                    d(j) = d(i)
                    d(i) = Dtmp
    
                End If
            Next j
        Next i
    was posted for sorting numbers in a listbox since VBs listbox sort falls short for sorting numbers, so I just expanded it for this sort by item data usage.

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