
正文
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 + ; /// <summary>
/// 设置图标间隔
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
public void SetSpacing(Int16 x, Int16 y)
{
SendMessage(this.lvZhuType.Handle, LVM_SETICONSPACING, , x * + y);
this.lvZhuType.Refresh();
}








