Vcl.ListActns.TCustomListAction.Count

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Count: Integer read GetCount;

C++

__property int Count = {read=GetCount, nodefault};

Properties

Type Visibility Source Unit Parent
property public
Vcl.ListActns.pas
Vcl.ListActns.hpp
Vcl.ListActns TCustomListAction

Description

Indicates the number of items this list action represents.

Read Count to determine the number of items the list action supplies to client controls. This value provides an upper limit to the index that is supplied to the GetItem method or the Strings property in order to fetch individual items.

In TCustomListAction, the value of Count is supplied by the OnGetItemCount event handler. If there is no OnGetItemCount event handler, the value of Count is –1. Thus, a Count of –1 indicates that Count is not defined, as opposed to 0, which indicates that there are no items.

Note: TCustomListAction descendants can override the Count property access method to supply a value to Count that does not rely on an event handler. For example, TStaticListAction stores all of its items in an internal list, and overrides GetCount to indicate the number of items in that list.

See Also