请一定指点小弟一下!!!!关于ListView的问题,我只有77分,以后多了一定给补上 ,谢谢!!!!!!!

Cappuccino 2001-12-12 07:59:38
请问各位大侠一个很菜的问题,如何在Listview的column上面绘上一个位图,就像Foxmail的邮件列表上面的headerCtrl一样,并且如何在listview和listbox 的item上绘上位图???写写一定感谢!!!!!万分感谢!!!最好能给一段源码以供参考学习!
...全文
124 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
liang_z 2001-12-12
  • 打赏
  • 举报
回复
小新,这个问题不菜吗?
如果只是column左边上一个位图,
那你只要设置column的ImageIndex就可以了,
前提是先设置Listview的smallimage!
Item也有ImageIndex的!
plusplus 2001-12-12
  • 打赏
  • 举报
回复
in general, you may create a bmp first, using Resource Editor.
Then, you will derive a class from CListCtrl, in your class, you will define a CImageList, for example, CImageList m_image, then create the image list using CImageList::LoadImage.
then, you will set the image list to the CListCtrl using CListCtrl::SetImageList.
hbxin1 2001-12-12
  • 打赏
  • 举报
回复
ListView的Column是可以接受图象的,
1.设置ListView的SmallImages
2.设置Column的imageindex属性
Everything is OK!
如果是运行时调入的图象,可以通过调入到ImageList中来实现。
呵呵,这可是我第二次答题哦。
plusplus 2001-12-12
  • 打赏
  • 举报
回复
sorry for can't input Chinese here.

for the column header:
you can add the image when you insert a column using CListCtrl::InsertColumn.
And please refer to iImage member of LVCOLUMN struct.

for items in ListView:
you can easily add one image for each item(not sub items) when you insert an item into the ListView using CListCtrl::InsertItem.
And please refer to iImage member of LVITEM struct. Maybe, you can add one image for each item and sub items using this method. But, I haven't tested it yet. And if it doesn't work for sub items, you may specify the OWNER-DRAW style for CListView, and then you can draw it yourself.

for ListBox, you may specify the OWNER-DRAW style, and then you can draw it yourself in CListBox::DrawItem. It is very easy. hehe. And try...
cobi 2001-12-12
  • 打赏
  • 举报
回复
这个问题不算菜了

5,930

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧