求救,在线等待:关于CListBox的基本使用
我现在没有帮助文档,请教关于CListBox的基本使用:
1 设置风格:不支持选择多行
2 得到指定列的字符串
问题点数:50、回复次数:6Top
1 楼arvid_gs(west)回复于 2003-01-08 12:25:52 得分 10
1.CListBox.ModiFyStyle( 0,LBS_MULTIPLESEL)
2.CListBox. GetItemData(index)Top
2 楼mensong(吉他乐手)回复于 2003-01-08 12:26:06 得分 10
1:默认的风格就仅支持单行,即在控件的属性里有Selection里,选择“Single”
2:建立一个相关联的CListBox变量,然后使用其成员函数:
void GetText( int nIndex, CString& rString ) const;
Return Value
The length (in bytes) of the string, excluding the terminating null character. If nIndex does not specify a valid index, the return value is LB_ERR.
Parameters
nIndex
Specifies the zero-based index of the string to be retrieved.
lpszBuffer
Points to the buffer that receives the string. The buffer must have sufficient space for the string and a terminating null character. The size of the string can be determined ahead of time by calling the GetTextLen member function.
rString
A reference to a CString object.
以及:
int GetCurSel( ) const;
Return Value
The zero-based index of the currently selected item. It is LB_ERR if no item is currently selected or if the list box is a multiple-selection list box.
Top
3 楼lihao_ningxia(耗子)回复于 2003-01-08 12:27:11 得分 5
up,还是多看看MSDN的帮忙吧Top
4 楼kinghawk(惊鸿)回复于 2003-01-08 12:28:36 得分 5
在MSND中索引CListBox。Top
5 楼qing_li73(Vincent Lee)回复于 2003-01-08 12:29:21 得分 10
See the tutorial below, FYI:
http://codeproject.com/combobox/listbox_tut.aspTop
6 楼sinhighly(非典型程序员)回复于 2003-01-08 12:49:56 得分 10
MSDN
upTop
7 楼dot_net(难道莫非岂不是)回复于 2003-01-08 14:55:36 得分 0
谢谢各位。btw:我现在没有msdnTop




