Sorts an item's children.

Syntax

rv = Send_Message(Ctrl, "OLE.Sort", Item, Direction, IncludeSubChildren)

Parameters

ParameterDescription
ItemThe item whose children to sort
DirectionThe sort direction, "Ascending" or "Descending"
IncludeSubChildrenDetermines whether or not all sub children are to be sorted too

Remarks

The Sort method performs a one-time sort of an item's children. The Item parameter is a key to the item whose children you wish to sort. Set this to "" if you want to sort the root level items. The Direction parameter can be set to "Ascending" or "Descending" to perform an ascending or descending sort respectively. Lastly, the IncludeSubChildren flag can be set to 1 if you want all the subchildren of that item to be sorted as well--all the way down to the last level. Set it to 0 if you only want to sort the items immediate children.

For persistent sorting, use the ItemSort or DefSort properties instead.

Example

// Assume a tree with boys and girls organized into teams 

// Sort the Blue Team in descending order 
Send_Message(@Window:".OLE_TREE", "OLE.Sort", "BlueTeam", "Descending", 0) 

// Sort the entire tree in ascending order 
Send_Message(@Window:".OLE_TREE", "OLE.Sort", "", "Ascending", 1)

See Also

ItemSortDefSort

  • No labels