简体   繁体   English

以前的工具提示仍然在鼠标移动,并且不刷新!

[英]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?我应该怎么办?

Check this article by me Here 在这里查看我的这篇文章

Write another namely Mouse_Leave and hide all the tool tips that you don't want to show写另一个即Mouse_Leave并隐藏所有您不想显示的工具提示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM