导航:  Windows Controls Procedures > List Box Control > Wrappers >

ListBox_SetCurSel

上一页返回章节概述下一页

描述

 

如果需要,选择一个字符串并将其滚动到视图中.当选择新字符串时,列表框将从前面选定的字符串中移除高亮显示.您可以使用此功能或发送LB_SETCURSEL消息明确

 

FreeBASIC 语法

#define ListBox_SetCurSel(hwndCtl, index)

 

参数

hListBox

[in]处理ListBox控件.

index

[in]指定的字符串,选择零基础的指标.如果这个参数是-1,列表框设置为不选择.

 

Microsoft Windows 95/Windows 98/Windows Millennium Edition (Windows Me): The index parameter is limited to 16-bit values. This means list boxes cannot contain more than 32,767 items. Although the number of items is restricted, the total size in bytes of the items in a list box is limited only by available memory.

 

返回值

 

如果发生错误,返回值是LB_ERR.如果wParam参数–1,返回值是LB_ERR即使没有发生错误.

 

备注

 

仅使用单个选择列表框使用此消息.不能使用它在多个选择列表框中设置或移除选择.

 

引用文件

 

WindowsX.bi