How to increase AutoPopDelay value for ListViewItems in WinForms?

后端 未结 3 1521
故里飘歌
故里飘歌 2021-01-23 01:22

You know that each item in a ListView has a ToolTipText property and that\'s all! There is no property like AutoPopDelay to set its displa

3条回答
  •  时光说笑
    2021-01-23 02:12

    To Hans Passant.

    I used this code in MouseHover event:

        Point pntOnList = lsvSource.PointToClient
            (new Point(Cursor.Position.X, Cursor.Position.Y));
        ListViewItem lsviUnderMouse =
            lsvSource.GetItemAt(pntOnList.X, pntOnList.Y);
        if (lsviUnderMouse != null)
        {
            ttipDetails.SetToolTip(lsvSource, lsviUnderMouse.ToolTipText);
            ttipDetails.Active = true;
        }
        else
        {
            ttipDetails.Active = false;
        }
    

    But it behaves strangely. Actually the ToolTip's text is always outdated.

提交回复
热议问题