[RESOLVED] VB gets confused on Lisview sort! Help!
Hey, I've never had trouble with this before, but here's the situation. In a listview control, my listitems are like "Aerosmith - Blind Man.mp3" , subitems(1) is the path "C:\MP3s", subitems(2) is a column titled "Artist", and subitems(3) is a column titled songname. The artist & songname fields are what the user sees in the listview. All other fields widths are set to 0. On the columnclick event you can sort your files by Artist OR Title. Problem is, VB gets confused here. After you sort by ascending & descending, the info gets mixed up somehow which doesn't make any sense to me! Basically what it does is when you sort by artist, it does just that, but ONLY by that. Since I'm sorting by a subitem of a listitem, it should resort the listitems as well to reflect the change but it doesn't. So I end up with something like this: listitem= ZZ Top - Tush.mp3 , Artist = AC DC, Songname= T.N.T. Why is it doing this?? Any help is EXTREMELY appreciated. here's my code below and the module I'm using to sort.
VB Code:
Private Sub ListView1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
If ColumnHeader.Index = 3 Then
Call SortLvwOnString(ListView1, 3)
End If
If ColumnHeader.Index = 4 Then
Call SortLvwOnString(ListView1, 4)
End If
End Sub
Last edited by hipopony66; May 8th, 2002 at 09:12 PM.