[英]previous tooltips remain on mouse move, and don't refresh!
in C#.NET winodws forms i handled manual tooltip texts for different ListBox items like this:在 C#.NET winodws forms 中,我为不同的 ListBox 项目处理了手动工具提示文本,如下所示:
private void lstFields_MouseMove(object sender, MouseEventArgs e)
{
ListBox lstBox = (ListBox)sender;
Point listBoxClientAreaPosition = lstBox.PointToClient(System.Windows.Forms.Cursor.Position);
int idx = lstBox.IndexFromPoint(listBoxClientAreaPosition);
if (idx == -1)
{
//toolTip1.SetToolTip(lstBox, null);
toolTip1.Hide(lstBox);
return;
}
Field fld = (Field)lstBox.Items[idx];
string strTooltip = string.Format("Descriptor: {0} , ISO Field Number: {1} , Custom Value : {2}",fld.FieldDescriptor,fld.ISOFieldNumber,fld.CustomValue);
if (toolTip1.GetToolTip(lstBox) == strTooltip)
{
return;
}
toolTip1.SetToolTip(lstBox, strTooltip);
}
it works, but the previously shown tooltips don't hide when i move the mouse fast.它可以工作,但是当我快速移动鼠标时,之前显示的工具提示不会隐藏。 what should i do?
我应该怎么办?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.