c#winform listview设置每项的间距
代码如下:
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] private static extern Int32 SendMessage(IntPtr hwnd, Int32 wMsg, Int32 wParam, Int32 lParam); const int LVM_FIRST = 0x1000; const int LVM_SETICONSPACING = LVM_FIRST + 53; /// <summary> /// 设置图标间隔 /// </summary> /// <param name="x"></param> /// <param name="y"></param> public void SetSpacing(Int16 x, Int16 y) { SendMessage(this.lvZhuType.Handle, LVM_SETICONSPACING, 0, x * 65536 + y); this.lvZhuType.Refresh(); }
本文来自博客园,作者:沉迷编程的程序员,转载请注明原文链接:https://www.cnblogs.com/codeDevotee/p/7300029.html
欢迎各位找我代写程序,python、c#、web等都可以,加我请注明博客园微信:A15919195482