设备项目中listview控件加网格

来源:互联网 发布:java第三方支付接口 编辑:程序博客网 时间:2024/06/12 01:39

[System.Runtime.InteropServices.DllImport("coredll.dll",EntryPoint = "SendMessage")]//给listview控件添加网格
       public static extern int SendMessage(
                                       IntPtrhWnd,            //  handle  to  destination  window  
                                       intMsg,              //  message  
                                       intwParam,      //  first  message  parameter  
                                       intlParam        //  second  message  parameter  
               );

const int LVM_SETEXTENDEDLISTVIEWSTYLE = 0x1000 +54;//定义网格参数的变量
SendMessage(this.list_Items.Handle, LVM_SETEXTENDEDLISTVIEWSTYLE,0, 1);//listview控件添加网格

重新定义消息后所有属性变成初始化。