在“列表"视图中创建仅包含一列的ListView [英] Create a ListView with Just One Column in 'List' View

查看:200
本文介绍了在“列表"视图中创建仅包含一列的ListView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如上所述,基本上我想要的就像老式的ListBox,只是带有图像列表中的漂亮图像.我是否可以强制Listview 将项目限制为仅一列,而不必诉诸详细信息"视图?

As per the above... basically what I want is like an old-fashioned ListBox, just with the spiffy images from an image list. Can I force a Listview to limit items to just one column without having to resort to ''Details'' view?

推荐答案

仅当您控制的大小和listview 项文本内容的长度.

listview 的大小和项目的长度将确定是否显示多于一列.

通过子类化,您也许可以找到可以限制列表"视图中的列的代码,但是遍历非常小的细节似乎很麻烦.

我不明白:详细信息"视图有什么问题,因为您是如此反对?

如果您隐藏列标题,则可以使其看起来完全像列表"视图一样.

如果您不赞成详细信息"视图,那么还有另一种可能性:

相反,请使用listbox 并尝试使用Google的一些代码来添加图像/图标.

例如,您可以看一下:

扩展列表框以显示更复杂的项目 [
Only if you control the listview''s size and the length of the contents of the listview item texts.

The size of the listview and the length of the items will determine if more than one column is shown.

You might be able to find code that can restrict the columns in "list" view by subclassing it, but it seems like a lot of trouble to go through for a very small detail.

I don''t understand: What''s wrong with "details" view since you are so set against it?

You can get it to look precisely like the "list" view if you hide the column headers...

If you are dead set against the "details" view, there is another possibility:

Go with the listbox instead and try to Google some code that lets you add images/icons.

You could for instance have a look at this:

Extending the ListBox to show more complex items[^]

Good luck!


这篇关于在“列表"视图中创建仅包含一列的ListView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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