CListBox Member Functions

Construction
CListBox Constructs a CListBox object.

Initialization
Create Creates the Windows list box and attaches it to the CListBox object.
InitStorage Preallocates blocks of memory for list box items and strings.

General Operations
GetCount Returns the number of strings in a list box.
GetHorizontalExtent Returns the width in pixels that a list box can be scrolled horizontally.
SetHorizontalExtent Sets the width in pixels that a list box can be scrolled horizontally.
GetTopIndex Returns the index of the first visible string in a list box.
SetTopIndex Sets the zero-based index of the first visible string in a list box.
GetItemData Returns the 32-bit value associated with the list-box item.
GetItemDataPtr Returns a pointer to a list-box item.
SetItemData Sets the 32-bit value associated with the list-box item.
SetItemDataPtr Sets a pointer to the list-box item.
GetItemRect Returns the bounding rectangle of the list-box item as it is currently displayed.
ItemFromPoint Returns the index of the list-box item nearest a point.
SetItemHeight Sets the height of items in a list box.
GetItemHeight Determines the height of items in a list box.
GetSel Returns the selection state of a list-box item.
GetText Copies a list-box item into a buffer.
GetTextLen Returns the length in bytes of a list-box item.
SetColumnWidth Sets the column width of a multicolumn list box.
SetTabStops Sets the tab-stop positions in a list box.
GetLocale Retrieves the locale identifier for a list box.
SetLocale Sets the locale identifier for a list box.

Single-Selection Operations
GetCurSel Returns the zero-based index of the currently selected string in a list box.
SetCurSel Selects a list-box string.

Multiple-Selection Operations
SetSel Selects or deselects a list-box item in a multiple-selection list box.
GetCaretIndex Determines the index of the item that has the focus rectangle in a multiple-selection list box.
SetCaretIndex Sets the focus rectangle to the item at the specified index in a multiple-selection list box.
GetSelCount Returns the number of strings currently selected in a multiple-selection list box.
GetSelItems Returns the indices of the strings currently selected in a list box.
SelItemRange Selects or deselects a range of strings in a multiple-selection list box.
SetAnchorIndex Sets the anchor in a multiple-selection list box to begin an extended selection.
GetAnchorIndex Retrieves the zero-based index of the current anchor item in a list box.

String Operations
AddString Adds a string to a list box.
DeleteString Deletes a string from a list box.
InsertString Inserts a string at a specific location in a list box.
ResetContent Clears all the entries from a list box.
Dir Adds filenames from the current directory to a list box.
FindString Searches for a string in a list box.
FindStringExact Finds the first list-box string that matches a specified string.
SelectString Searches for and selects a string in a single-selection list box.

Overridables
DrawItem Called by the framework when a visual aspect of an owner-draw list box changes.
MeasureItem Called by the framework when an owner-draw list box is created to determine list-box dimensions.
CompareItem Called by the framework to determine the position of a new item in a sorted owner-draw list box.
DeleteItem Called by the framework when the user deletes an item from an owner-draw list box.
VKeyToItem Override to provide custom WM_KEYDOWN handling for list boxes with the LBS_WANTKEYBOARDINPUT style set.
CharToItem Override to provide custom WM_CHAR handling for owner-draw list boxes which don't have strings.

See Also

CListBox Overview, Control Classes