BaseListBox.FindItem Method (Typed) | |
Search a list box for a specified string, and return the location of the first item in the list box that matches it.
Namespace:
XSharp.VO.SDK
Assembly:
XSharp.VOGUIClasses (in XSharp.VOGUIClasses.dll) Version: 2.21
Syntax VIRTUAL METHOD FindItem(
cItem AS STRING,
lWholeItem AS LOGIC,
nStart AS LONG
) AS LONG
public virtual int FindItem(
string cItem,
[DefaultParameterValueAttribute(true, 0)] bool lWholeItem,
[DefaultParameterValueAttribute(0, 0)] int nStart
)
Request Example
View SourceParameters
- cItem
- Type: String
The text to search for. - lWholeItem
- Type: Logic
Indicates how the search is to be performed. TRUE matches an exact cItem string to a 'whole' list box item (for example, a 'can' string does not match 'scan'). FALSE finds a match for any list box prefixed by cItem (for example, the string 'cat' would match 'catalog' in the list box). The default is TRUE.
- nStart
- Type: Long
Specifies the one-based index of the item before the first item to be searched. When the search reaches the bottom of the list box, it continues searching from the top of the list box back to the item specified by the nStart parameter. If nStart is 0, the entire list box is searched from the beginning.
Return Value
Type:
Long
The position of the first item that contains the matching text, if a match is found (a value of 1 refers to the first position in the list box); if no match is found, 0 is returned.
For example, if
cItem matched the fifth string in the list box, the return value would be 5. This means that no earlier string in the list box matched it.
See Also