LB_SETCARETINDEX message

将焦点矩形设置为多选列表框中指定索引处的项。 如果该项不可见,则会滚动到视图中。

Parameters

wParam

指定要接收焦点矩形的列表框项的从零开始的索引。

Windows 95/Windows 98/Windows Millennium Edition (Windows Me) : The wParam parameter is limited to 16-bit values. 这意味着列表框不能包含超过 32,767 个项目。 尽管项数受到限制,但列表框中项的总大小(以字节为单位)仅受可用内存的限制。

lParam

If this value is FALSE, the item is scrolled until it is fully visible; if it is TRUE, the item is scrolled until it is at least partially visible.

Return value

如果发生错误,则返回值LB_ERR(-1)。 否则,将返回LB_OKAY (0)。

Remarks

If this message is sent to a single-selection list box that does not contain a selected item, the caret index is set to the item specified by the wParam parameter. 如果单选列表框包含选定项,则列表框将返回LB_ERR。

Requirements

Requirement Value
支持的最低客户端
Windows Vista [仅限桌面应用]
支持的最低服务器
Windows Server 2003 [仅限桌面应用]
Header
Winuser.h (包括 Windows.h)

See also

LB_GETCARETINDEX