如何将图标添加到listview子图? [英] How can i Add Icons to listview subitmes?

查看:70
本文介绍了如何将图标添加到listview子图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

晚上好

我上面有这个listview1

i have this listview1 above

我想在Number Column中添加图标 

i want to add icons in Number Column 

所以我该怎么做?

我希望每当我通过文本框输入任何数字时,数字列将为所有数字添加相同的图标

i want whenever i enter any number through textbox the number column will add the same icon to all numbers

你能建议吗?

推荐答案

最简单的方法是将ListView.SmallImageList与ImageList相关联,然后为每个ListViewItem设置ImageKey或ImageIndex。 这会将图标放在第一列之前。

The easiest thing is to associate the ListView.SmallImageList with an ImageList and then set the ImageKey or ImageIndex for each ListViewItem.  This will place the icon before the first column.

如果这是不可接受的,那么你将需要自定义绘制更复杂的ListViewItems。

If that is not acceptable then you will have to get into custom drawing the ListViewItems which is more complex.


这篇关于如何将图标添加到listview子图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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