#region 该方法实现控制ListView的距离
/// <summary>
/// 控制ListView项之间的距离
/// </summary>
/// <param name="Handle"></param>
/// <param name="wMsg"></param>
/// <param name="wParam">水平间距</param>
/// <param name="lParam">垂直间距</param>
/// <returns></returns>
[DllImport("user32.dll")]
private static extern int SendMessage(int Handle, int wMsg, int wParam, int lParam); const int LVM_FIRST = 0x1000;
const int LVM_SETICONSPACING = LVM_FIRST + 53; public static void SetListViewSpacing(ListView lst, int x, int y)
{
SendMessage(lst.Handle.ToInt32(), LVM_SETICONSPACING, 0, x * 1 + y);
}
#endregion private void FacesForm_Load(object sender, EventArgs e)
{ SetListViewSpacing(listView1, 1, 10); //加载时赋值
} 代码如上 。 今天中午用XP 打开的时候 。 这代码可以 。
但是回家用win7 打开时 。 。
却是令我火大 。
又将距离拉大了变回 问题已经写在#region 那里了 。
win7打开的时候距离有这么大 谁能帮我改下 。 能在win7 。 也可以在XP的 实用方法 在线等回复
这样混分可不是我的作风。
你吧你的测试项目发到[email protected]
我试试吧。不确定。尽力试试。