在Winform的ListView上面鼠标放到某一行的时候提示
![](https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif)
//实现黄底黑字的提示效果用ToolTip控件:
private void listView1_MouseMove(object sender, MouseEventArgs e)
{
ListViewItem item = this.listView1.GetItemAt(e.X, e.Y);
if (item != null)
{
toolTip1.Show(item.Text, listView1, new Point(e.X + 15, e.Y + 15), 1000);
toolTip1.Active = true;
}
else
{
toolTip1.Active = false;
}
}
//实现形状不规则用ToolTip控件的SetToolTip方法
private void listView1_MouseMove(object sender, MouseEventArgs e)
{
ListViewItem item = this.listView1.GetItemAt(e.X, e.Y);
if (item != null)
{
toolTip1.Show(item.Text, listView1, new Point(e.X + 15, e.Y + 15), 1000);
toolTip1.Active = true;
}
else
{
toolTip1.Active = false;
}
}
//实现形状不规则用ToolTip控件的SetToolTip方法