Vcl.ListActns.TCustomVirtualListAction.GetItem

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetItem(const Index: Integer; var Value: String;  var ImageIndex: Integer; var Data: TCustomData): Boolean;

C++

bool __fastcall GetItem(const int Index, System::UnicodeString &Value, int &ImageIndex, void * &Data);

Properties

Type Visibility Source Unit Parent
function protected
Vcl.ListActns.pas
Vcl.ListActns.hpp
Vcl.ListActns TCustomVirtualListAction

Description

Provides information about a specified item.

When you set the Active property to True, the virtual list action supplies items to client controls through a series of calls to GetItem, one for each item. GetItem collects the information about each item by generating an OnGetItem event. It returns True if there is an OnGetItem event handler to provide information about the item, which is returned using the GetItem parameters. GetItem returns False if it cannot supply information about the item because there is no OnGetItem event handler. Index indicates which item is desired, where 0 indicates the first item, 1 indicates the second item and so on up to the number of items specified by the Count property. Value returns the string value of the item. This is the text that appears in the client combo box or list box. ImageIndex returns the index of an image associated with the item. If the item is not associated with an image, ImageIndex returns –1. Otherwise, it returns the index of an image in the Images property. Data returns a pointer to application-defined data that is associated with the item. For client controls that store items in a TStrings object, Data supplies the value of the Objects property for the item.

See Also