RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomListBox.DoFindData Method

Returns the index of a string in the list box.

Pascal
function DoFindData(const Data: String): Integer;
C++
__fastcall int DoFindData(const AnsiString Data);

This protected method is called automatically when the list box needs to indicate the index for an item.  

If the list box is virtual (that is, if the value of the Style property is lbVirtual or lbVirtualOwnerDraw), DoFindData generates an OnDataFind event so that the index can be provided dynamically. If the list box is not virtual (any other Style), DoFindData locates the specified string from the Items property and returns its index. 

Data is the text of the item to locate. 

 

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