简体   繁体   English

我可以在 MFC CListBox 中添加多列吗?

[英]Can I add multiple columns in MFC CListBox?

I have a dialog with a CListBox .I have to add 3 Columns in this list box.我有一个带有CListBox的对话框。我必须在这个列表框中添加 3 列。
Is there any way to have several different columns in CListBox ?有没有办法在CListBox有几个不同的列?
Or Can CListCtrl help in this regard?或者CListCtrl可以在这方面提供帮助吗?

  • Listbox has list of items in 1 column, a list-control can have zero or more columns.列表框在 1 列中有项目列表,列表控件可以有零个或多个列。
  • Natively, listbox does not have icon attached to it, list control has.本来,列表框没有附加图标,列表控件有。
  • List control has "header control" on top of it, which can be used to arrange and/or sort the items in columns.列表控件在其顶部具有“标题控件”,可用于对列中的项目进行排列和/或排序。
  • List Control (also know as report control) can have 4 or more view types (depending on OS) - icon, small icon, details/report, list and thumbnail.列表控件(也称为报表控件)可以有 4 种或更多视图类型(取决于操作系统)- 图标、小图标、详细信息/报表、列表和缩略图。

The windows explorer file view (right side) is list control, fonts in Fonts dialog box is listbox. windows资源管理器文件视图(右侧)是列表控件,字体对话框中的字体是列表框。

Source : http://forums.codeguru.com/showthread.php?358739-CListBox-and-CListCtrl .来源: http : //forums.codeguru.com/showthread.php?358739-CListBox-and-CListCtrl

use CListCtrl::InsertColumn to add new column.使用CListCtrl::InsertColumn添加新列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM