c# listView里面鼠标悬停在listView某个子项时子项的字体颜色改变

2024-12-22 14:38:43
推荐回答(1个)
回答1:

如果您有其他问题,可以继续追问哦.

主要代码为:

private void listView1_ItemMouseHover(object sender, ListViewItemMouseHoverEventArgs e)
{
foreach (ListViewItem item in this.listView1.Items)
{
item.BackColor = Color.White;
}
e.Item.BackColor = Color.Red;
}