Valhalla Legends Forums Archive | Visual Basic Programming | Sorting VB6 ListViews

AuthorMessageTime
KrAzY_NuK
Hey all, Haven't been around in a while.

Quick question.  I've done some searching on google, and within this form, and haven't found an answer.

Using VB6, does anybody know if it's possible to sort a ListView by it's Tag property?

I know how to sort by any of the viewable columns, that's easy, but I can't seem to find any way to sort by tag.

Thanks,
Glenn
March 21, 2006, 5:03 PM
Grok
I have never heard of that being done.  Why do you think it is possible?  I could see creating a columnheader with the value from tag in it, but you already know you could do that.
March 21, 2006, 8:35 PM
RealityRipple
Not very hard. Here's a link to an example:
http://realityripple.com/MyStuff/TagSortExample.zip

btw, the sorting method i used was a SelectionSort... I guess you could sort it using other methods, but Selections always seemed cleanest to me.
March 21, 2006, 9:12 PM
KrAzY_NuK
Grok:
I was just hoping it was possible.  Instead, I just added a hidden column.

RealityRipple:
Thanks for that, but I was hoping to use the built in VB stuff.  I'll check out your example later though.
March 22, 2006, 12:19 AM
Topaz
I don't think there's an inherent function for it - instead, you could write a function that copies all the tags to an array and sort it from there.
March 22, 2006, 1:47 AM

Search