LBS_MULTIPLESEL和LB_ADDSTRING [英] LBS_MULTIPLESEL and LB_ADDSTRING

查看:130
本文介绍了LBS_MULTIPLESEL和LB_ADDSTRING的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

test=CreateWindow("listbox", NULL, WS_VISIBLE|WS_CHILD|WS_BORDER|LBS_NOTIFY|LBS_MULTICOLUMN, 120,70,250,330, hwnd, (HMENU)IDM_BLB, NULL, NULL);





创建上面的列表框后,我想使用LB_ADDSTRING将字符串放入列表框中

但问题是我不知道如何区分两列



After creating above listbox, I want to put string in listbox using LB_ADDSTRING
But the problem is that I don't know how to distinguish two columns

SendMessage(test, LB_ADDSTRING, 0, (LPARAM)"where");



如果我喜欢上面的代码,字符串将显示在第一列。

如何显示数据我要放入的栏目?



已添加代码块[/ Edit]


If I do like above code, the string will be displayed in first column.
How can I display data in the column that I want to put in ?

Code block added[/Edit]

推荐答案

你没有; 列表框 [ ^ ]是一个简单的项目列表。如果您想要一个包含多列的列表,那么您必须使用 列表视图 [ ^ ]。



我刚刚意识到我昨天在这个问题 [ ^ ]。请阅读我提供链接的文档,而不是再次重复相同的问题。
You don't; a List Box[^] is a simple list of items. If you want a list with multiple columns then you must use a List View[^].

I just realised that I explained this to you yesterday in this question[^]. Please read the documentation that I have provided the links for rather than repeat the same question again.


这个答案有点晚了但是这里是



LBS_MULTICOLUMN用于水平滚动。所有列的大小都相同,并且必须使用LB_SETCOLUMNWIDTH设置大小。例如,如果有一个4行3列的lisbox,[第1行,第2列]是第5个字符串,[第2行,第3列]是第9个字符串。



LBS_MULTICOLUMN不响应WM_VSCROLL,不能与LBS_OWNERDRAWVARIABLE一起使用。基本上,你不能轻易地用列表框做你想做的所有事情。



使用列表视图更容易多列除外,与列表框不同,它不能处理可变高度的行。
This answer is a bit late but here goes

LBS_MULTICOLUMN is meant for horizontal scrolling. All the columns are the same size and the size has to be set by using LB_SETCOLUMNWIDTH. If for example, there is a lisbox of 4 rows and 3 columns, [row 1, column 2] is the 5th string, [row 2, column 3] is the 9th string.

LBS_MULTICOLUMN does not respond to a WM_VSCROLL and cannot be used with LBS_OWNERDRAWVARIABLE. Basically, you can't easily do all the things you would like to do with a listbox.

It is a lot easier to use a listview for multiple columns except that, unlike listboxes, it cannot handle variable height rows.


这篇关于LBS_MULTIPLESEL和LB_ADDSTRING的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆