共用方式為


CListBox Members

Base Class Members

ConstructionInitialization

General OperationsSingle-Selection Operations

Multiple-Selection Operations

String Operations

Overridables

Base Class Members

CObject Members

CCmdTarget Members

CWnd Members

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.

GetItemData

Returns the 32-bit value associated with the list-box item.

GetItemDataPtr

Returns a pointer to a list-box item.

GetItemHeight

Determines the height of items in a list box.

GetItemRect

Returns the bounding rectangle of the list-box item as it is currently displayed.

GetListBoxInfo

Retrieves the number of items per column.

GetLocale

Retrieves the locale identifier for 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.

GetTopIndex

Returns the index of the first visible string in a list box.

ItemFromPoint

Returns the index of the list-box item nearest a point.

SetColumnWidth

Sets the column width of a multicolumn list box.

SetHorizontalExtent

Sets the width in pixels that a list box can be scrolled horizontally.

SetItemData

Sets the 32-bit value associated with the list-box item.

SetItemDataPtr

Sets a pointer to the list-box item.

SetItemHeight

Sets the height of items in a list box.

SetLocale

Sets the locale identifier for a list box.

SetTabStops

Sets the tab-stop positions in a list box.

SetTopIndex

Sets the zero-based index of the first visible string in 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

GetAnchorIndex

Retrieves the zero-based index of the current anchor item in a list box.

GetCaretIndex

Determines the index of the item that has the focus rectangle 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.

SetCaretIndex

Sets the focus rectangle to the item at the specified index in a multiple-selection list box.

SetSel

Selects or deselects a list-box item in a multiple-selection list box.

String Operations

AddString

Adds a string to a list box.

DeleteString

Deletes a string from a list box.

Dir

Adds filenames, drives, or both 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.

InsertString

Inserts a string at a specific location in a list box.

ResetContent

Clears all the entries from a list box.

SelectString

Searches for and selects a string in a single-selection list box.

Overridables

CharToItem

Override to provide custom WM_CHAR handling for owner-draw list boxes which don't have strings.

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.

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.

VKeyToItem

Override to provide custom WM_KEYDOWN handling for list boxes with the LBS_WANTKEYBOARDINPUT style set.

See Also

Reference

CListBox Class

Hierarchy Chart