Help Center

CListBox.SelectStringmethod

Searches a list box for an item that begins with the characters in a specified string.

WindowsmethodCListBox.incdocumented

Syntax

FUNCTION SelectString (BYVAL hListBox AS HWND, BYVAL start AS LONG, BYVAL pwszText AS WSTRING PTR) AS LONG
FUNCTION SelectString (BYVAL hListBox AS HWND, BYVAL index AS LONG =-1) AS LONG

Parameters

NameDescription
hListBoxThe handle of the listbox control.
startThe zero-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 start parameter. If start is -1, the entire list box is searched from the beginning.
pwszTextA pointer to the null-terminated string that contains the prefix for which to search. The search is case independent, so this string can contain any combination of uppercase and lowercase letters.
indexThe zero-based index of the item to be selected.

Description

Searches a list box for an item that begins with the characters in a specified string. If a matching item is found, the item is selected.

Example

CListBox.SelectString(hListBox, 3, "Item 10") CListBox.SelectString(hListBox, 5)

Reference

  • Include file CListBox.inc
  • Defined in AfxNova/CListBox.inc:411
  • Documented in Windows/WIndows Controls/CListBox Class.md
  • Topic: CListBox Class