关于listctrl的自绘

sup_ace 2013-04-23 11:12:23
我对listctrl 进行了分组
然后在每个item上添加了 image 和 label

但是没有达到我预想的效果

我现在想能否对每个item进行自绘 在每个item上进行 StretchBlt DrawIcon TextOut 这些操作

能否实现?该怎么做呢?
...全文
111 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
我的资源里有,画好的你可以看一下。
菜牛 2013-04-23
  • 打赏
  • 举报
回复
CustomDraw分阶段,就是pLVCD->nmcd.dwDrawStage这个状态,在每个阶段的返回值决定了下个阶段的走向;响应CDDS_PREPAINT时返回CDRF_NOTIFYITEMDRAW才会在后续发送绘制列表项目的消息;具体参见MSDN说明: Return code Description CDRF_DODEFAULT The control will draw itself. It will not send any additional NM_CUSTOMDRAW notification codes for this paint cycle. This occurs when dwDrawStage equals CDDS_PREPAINT. CDRF_DOERASE Windows Vista. The control will not draw the focus rectangle around an item. CDRF_NOTIFYITEMDRAW The control will notify the parent of any item-related drawing operations. It will send NM_CUSTOMDRAW notification codes before and after drawing items. This occurs when dwDrawStage equals CDDS_PREPAINT. CDRF_NOTIFYPOSTERASE The control will notify the parent after erasing an item. This occurs when dwDrawStage equals CDDS_PREPAINT. CDRF_NOTIFYPOSTPAINT The control will notify the parent after painting an item. This occurs when dwDrawStage equals CDDS_PREPAINT. CDRF_NEWFONT The application specified a new font for the item; the control will use the new font. For more information about changing fonts, see Changing fonts and colors. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT. CDRF_NOTIFYSUBITEMDRAW Version 4.71. Your application will receive an NM_CUSTOMDRAW control code with dwDrawStage set to CDDS_ITEMPREPAINT | CDDS_SUBITEM before each list-view subitem is drawn. You can then specify font and color for each subitem separately or return CDRF_DODEFAULT for default processing. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT. CDRF_SKIPDEFAULT The application drew the item manually. The control will not draw the item. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT. CDRF_SKIPPOSTPAINT Windows Vista. The control will only paint the background.

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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