SortALLTreeviewItemsbyNameAscending
Posted: Sat Dec 17, 2005 11:50 am
Code updated For 5.20+
I can't understand why it is so fast.
I've tried it with more than 200000 items; parents, childs, and parents of parents, and it sorts ipsofact
Code: Select all
Procedure SortALLTreeviewItemsbyNameAscending(TVGadget)
For t=0 To CountGadgetItems(TVGadget)-1
If SendMessage_(GadgetID(TVGadget),#TVM_GETNEXTITEM,#TVGN_CHILD,GadgetItemID(TVGadget,t));<-if it is a parent:
SendMessage_(GadgetID(TVGadget),#TVM_SORTCHILDREN,0,GadgetItemID(TVGadget,t));<-sort all these childs
EndIf
Next
SendMessage_(GadgetID(TVGadget),#TVM_SORTCHILDREN,0,0);<-sort those without parent
EndProcedure

I've tried it with more than 200000 items; parents, childs, and parents of parents, and it sorts ipsofact
