日期:2014-05-17 浏览次数:20850 次
private Int32 _LastHoverIndex = -1; private void listView1_ItemMouseHover(object sender, ListViewItemMouseHoverEventArgs e) { if (_LastHoverIndex != -1) { listView1.Items[_LastHoverIndex].ForeColor = System.Drawing.SystemColors.WindowText; } e.Item.ForeColor = System.Drawing.Color.Red; _LastHoverIndex = e.Item.Index; }
------解决方案--------------------
if (_LastHoverIndex != -1 && e.Item.Index != _LastHoverIndex)
少了个条件
------解决方案--------------------
这么好的方法还叫拆中啊