Vcl.ComCtrls.TListView.OnCompare
Delphi
property OnCompare;
C++
__property OnCompare;
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| event | published | Vcl.ComCtrls.pas Vcl.ComCtrls.hpp |
Vcl.ComCtrls | TListView |
Description
Occurs when two items need to be compared during a sort of the list.
Vcl.ComCtrls.TListView.OnCompare inherits from Vcl.ComCtrls.TCustomListView.OnCompare. All content below this line refers to Vcl.ComCtrls.TCustomListView.OnCompare.
Occurs when two items need to be compared during a sort of the list.
Write an OnCompare event handler to implement a sort order for the list. An OnCompare event handler is called when the SortType property is stData or stBoth, when the AlphaSort method is called, or when the CustomSort method is called without a SortProc parameter.
The OnCompare event handler compares the list items passed as the Item1 and Item2 parameters. If Item1 is the same as Item2 in the sort order, set the Compare parameter to 0. If Item1 is less than Item2, set the Compare parameter to a value less than 0. If Item1 is greater than Item2, set the Compare parameter to a value greater than 0.
OnCompare is an event handler of type Vcl.ComCtrls.TLVCompareEvent.
See Also
Code Examples