RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TListControlItems.OnCompare Event

Occurs to when two items need to be compared for sorting the collection.

Pascal
property OnCompare: TListCompareEvent;
C++
__property TListCompareEvent OnCompare;

Write an OnCompare event handler to indicate the sort order when the SortType property is stData or stBoth. 

The OnCompare event handler compares the items passed as the Item1 and Item2 parameters. If Item1 is the same as Item2 in the sort order, the event handler should return 0. If Item1 is less than Item2, the event handler should return a value less than 0. If Item1 is greater than Item2, the event handler should return value greater than 0. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!