发送消息给系统API问题(listview )
现在做一个系统是winform的,其中用到了listview做列表显示,listview存在缺陷
1>利用他现在有的功能,listview的列和行的间距不能够调整大小,除非你修改他的ImageList的大小,那么图标的大小就会变化
这个可以用windows系统API函数解决,在Form 的Load事件里面加入:
private int LVM_SETICONSPACING = 0x1035;
[DllImport("user32.dll", CharSet = CharSet.Auto)]//set the width and height for the listview
public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);
Win32API.SendMessage(this.myPoplistview.Handle, LVM_SETICONSPACING, 0, 0x10000 * 85 + 87);
85和87分别是行间距和列间距
2>现在的问题是第一行与顶部的距离不能够改变,第一列与左边的距离不能能够改变,因为我不知道这个系统的API是什么,请问有哪位仁兄知道怎么调整listview与顶部和左部的间距吗?谢谢