MSDN NM_CUSTOMDRAW (list view) 中文翻译

Wesley13
• 阅读 749

NM_CUSTOMDRAW (list view) Notification

**NM_CUSTOMDRAW(list view)**通知


Sent by a list-view control to notify its parent windows about drawing operations. This notification is sent in the form of a WM_NOTIFY message.

list-view控件向其父窗口发送重绘操作的通知。这些通知以WM_NOTIFY消息的形式发送。

Syntax

NM_CUSTOMDRAW

lpNMCustomDraw = (LPNMLVCUSTOMDRAW) lParam;

Parameters

lpNMCustomDraw

Pointer to a NMLVCUSTOMDRAW structure that contains information about the drawing operation. The first member of this structure, nmcd, is a pointer to an NMCUSTOMDRAW structure. The dwItemSpec member of the structure pointed to by nmcd contains the identifier of the item being drawn and the lItemlParam member contains its application-defined data.

包含重绘操作信息的NMLVCUSTOMDRAW结构体指针。Nmcd是此结构体的第一个成员,它是指向NMCUSTOMDRAW结构体的指针。Nmcd的结构体包含了正被重绘成员的标识符dwItemSpec和应用程序定义的数据lItemlParam

Return Value

The value your application can return depends on the current drawing stage. The dwDrawState member of the associated NMCUSTOMDRAW structure holds a value that specifies the drawing stage. You must return one of the following values.

程序的返回值可以根据当前的绘制阶段而定。NMCUSTOMDRAW结构体成员dwDrawState指定了一个代表当前状态的值。你必须返回下列这些值。

CDRF_DODEFAULT

The control will draw itself. It will not send any additional NM_CUSTOMDRAW messages for this paint cycle. This occurs when dwDrawState equals CDDS_PREPAINT.

控件将绘制自己。它将不再为循环绘画发送额外的NM_CUSTOMDRAW消息。当dwDrawState****为CDDS_PREPAINT时将发生这种情况。

CDRF_DOERASE

Windows Vista. The control will not draw the focus rect around an item.

在Windows Vista中,控件将不再绘制项目焦点周围的矩形。

CDRF_NOTIFYITEMDRAW

The control will notify the parent of any item-related drawing operations. It will send NM_CUSTOMDRAW notification messages before and after drawing items. This occurs when dwDrawState equals CDDS_PREPAINT.

控件将通知绘画操作给任何项目相关的父窗口。在重绘前后它将发送CUSTOMDRAW通知。当dwDrawState****为CDDS_PREPAINT时将发生这种情况。

CDRF_NOTIFYITEMERASE

Windows NT 4.0 only. The control will notify the parent when an item will be erased. It will send NM_CUSTOMDRAW notification messages before and after erasing items. This occurs when dwDrawState equals CDDS_PREPAINT.

只对Windows NT 4.0有效。当控件要擦除一个项目时它将通知其父窗口。在重绘前后它将发送CUSTOMDRAW通知。当dwDrawState****为CDDS_PREPAINT时将发生这种情况。

CDRF_NOTIFYPOSTERASE

The control will notify the parent after erasing an item. This occurs when dwDrawState equals CDDS_PREPAINT.

当控件擦除一个项目后它将通知其父窗口。当dwDrawState****为CDDS_PREPAINT时将发生这种情况。

CDRF_NOTIFYPOSTPAINT

The control will notify the parent after painting an item. This occurs when dwDrawState equals CDDS_PREPAINT.

当控件重绘一个项目后它将通知其父窗口。当dwDrawState****为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 dwDrawState equals CDDS_ITEMPREPAINT.

当应用程序为项目设定新字体,控件也将使用这个新字体。更多关于改变字体的信息请参考Changing fonts and colors。当dwDrawState****为CDDS_ITEMPREPAINT时将发生这种情况。

CDRF_NOTIFYSUBITEMDRAW

Version 4.71. Your application will receive an NM_CUSTOMDRAW message with dwDrawState 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 dwDrawState equals CDDS_ITEMPREPAINT.

4.71版本。在list-view 子项目被重绘前应用程序将接收到NM_CUSTOMDRAW消息,而dwDrawState 被设置为 CDDS_ITEMPREPAINT | CDDS_SUBITEM。当dwDrawState****为CDDS_ITEMPREPAINT时将发生这种情况。

CDRF_SKIPDEFAULT

The application drew the item manually. The control will not draw the item. This occurs when dwDrawState equals CDDS_ITEMPREPAINT.

应用程序手动重绘项目。控件不会绘制项目。当dwDrawState****为CDDS_ITEMPREPAINT时将发生这种情况。

CDRF_SKIPPOSTPAINT

Windows Vista. The control will only paint the background.

在Windows Vista中,控件将只绘制背景。

Remarks

Version 5.80. If you change the font by returning CDRF_NEWFONT, the list-view control might display clipped text. This behavior is necessary for backward compatibility with earlier versions of the common controls. If you want to change the font of a list-view control, you will get better results if you send a CCM_SETVERSION message with the wParam value set to 5 before adding any items to the control.

Version 5.80.如果你通过返回CDRF_NEWFONT改变字体,list-view控件可能会显示省略的文本信息。这样做主要是为了向后兼容早期的通用控件版本。如果你想改变list-view控件的字体,在给控件添加任何项目前发送CCM_SETVERSION消息并将_wParam_设为5,你将得到更好的结果。

Notification Requirements

Minimum DLL Version

comctl32.dll version 4.70 or later

Header

commctrl.h

Minimum operating systems

Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0

点赞
收藏
评论区
推荐文章
blmius blmius
3年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Kent_Sun Kent_Sun
3年前
java中List数组遍历删除
List数组遍历删除环境jdk8junit单元测试正解java//正解1,jdk自带的addAll方法@Testpublicvoidtest18(){Stringstrs{"12","34","56","78","90"};List<StringlistAr
Stella981 Stella981
3年前
ClickableSpan造成Listview的OnItemClickListener失效的解决办法
一、前提和解决做了个界面,在listview的itemview里要@,要超链接,要话题跳转等等等。用ClickableSpan实现了textview的点击跳转,之后发现listview的OnItemClickListener不响应,给textview的focusable设置为false,或者listview的descendantFocusabi
Stella981 Stella981
3年前
ListView不同的Holder的应用
ListView不同的Holder的应用ListView需要解析的Gson格式!enterdescriptionhere(http://static.oschina.net/uploads/img/201508/20193352_QOYm.jpg"1440065760741.jpg")
Stella981 Stella981
3年前
Android中的Selector的用法
Android中的Selector主要是用来改变ListView和Button控件的默认背景。其使用方法可以按一下步骤来设计:(以在mylist\_view.xml为例)1.创建mylist\_view.xml文件首先在res目录下新建drawable文件夹,再在新建的drawable文件夹中新建mylist\_view.xml,
Wesley13 Wesley13
3年前
Android开发之列表控件
一、基础知识:ListView是一个经常用到的控件,ListView里面的每个子项Item可以使一个字符串,也可以是一个组合控件。先说说ListView的实现:1.准备ListView要显示的数据;2.使用一维或多维动态数组保存数据;3.构建适配器,简单地来说,适配器就是Item数组,动态数组有多少元素就生成多少个Item;4.把适配器添
Stella981 Stella981
3年前
Android开源项目分类汇总
第一部分个性化控件(View)主要介绍那些不错个性化的View,包括ListView、ActionBar、Menu、ViewPager、Gallery、GridView、ImageView、ProgressBar、TextView、ScrollView、TimeView、TipView、FlipView、Color
Stella981 Stella981
3年前
Android蓝牙连接汽车OBD设备
//设备连接public class BluetoothConnect implements Runnable {    private static final UUID CONNECT_UUID  UUID.fromString("0000110100001000800000805F9B34FB");
Stella981 Stella981
3年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable