CListCtrl中的不同图像 [英] Different images in CListCtrl

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

问题描述





我想使用CImageList类在列表控件中添加多个图像。我知道我们可以添加多个图像作为ICON,列表控制属性为ICON。但我想在报告视图中的CListCtrl中显示图像,就像我们在移动电话中看到的那样,即第一列用户图像和第二列及其详细信息。

有人可以建议我如何使用CImageList类或者我们可以使用任何替代方法在不同的行中加载不同的图像。



Regds

SNI

Hi,

I want to add multiple images in list control using CImageList class. I know we can add multiple images as ICON with list control property as ICON. But I want to show images in CListCtrl in Report view, the same way as we see our contacts in mobile phones i.e in first column user image and second column with its details.
Can someone suggest me how to use CImageList class or there is any alternative we can use to load different images in different rows.

Regds
SNI

推荐答案

ListCtrl中的图像列表确实更适合于表示一组有限的小图像,例如文件类型或状态指示器。



在你的情况下,我将ListCtrl所有者绘制,在项目的用户数据部分存储指向图像的指针,并在所有者绘制代码中绘制图像。如果你开始更强烈地使用列表控件我会建议熟悉所有者绘制和自定义绘制功能无论如何。 MSDN通常是一个开始阅读的好地方。
The image lists in a ListCtrl are indeed more geared towards representing a limited set of small images, for example as file type or status indicators.

In your case I would make the ListCtrl owner-drawn, store a pointer to the image in the user-data part of the item and draw the image in the owner draw code. If you are starting to work with list controls more intensely I would recommend to get acquainted with the owner draw and custom draw functionality anyhow. MSDN is as usual a good place to start reading.


这篇关于CListCtrl中的不同图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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