Vcl.ListActns.TListControlItems.OnCompare

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnCompare: TListCompareEvent read FOnCompare write FOnCompare;

C++

__property TListCompareEvent OnCompare = {read=FOnCompare, write=FOnCompare};

Properties

Type Visibility Source Unit Parent
event published
Vcl.ListActns.pas
Vcl.ListActns.hpp
Vcl.ListActns TListControlItems

Description

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

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.

See Also