如何在文本索引中显示工具提示,而不是在MouseCursor上显示

本文关键字:显示 MouseCursor 工具提示 文本 索引 | 更新日期: 2023-09-27 18:11:24

工具提示是否可能位于textindex而不是鼠标光标中?

注意我的工作提示在Windows形式的文本。

下面是我的示例工具提示:
 toolTip1.AutoPopDelay = 5000;
        toolTip1.InitialDelay = 1000;
        toolTip1.ReshowDelay = 500;
        //toolTip1.ShowAlways = true;
        toolTip1.ToolTipTitle = "<)( Text ToolTip )(>";
        toolTip1.UseFading = true;
        toolTip1.UseAnimation = true;

参数:

 for (int i = 0; i < keywords.Length; i++)
            {
                if (keywords[i] == token)
                {
                    // Apply alternative color and font to highlight keyword.        
                    HighlighType.keywordsType(rtb);
                        toolTip1.Show("this is a keyword", rtb); //&
                        break;
                }
            }

当一个关键字将在richtextbox中键入时,例如"as",工具提示将出现,但仅在MOUSEcursor中,我希望它靠近textindex。

这可能吗?非常感谢!

如何在文本索引中显示工具提示,而不是在MouseCursor上显示

您需要将ToolTip.Show (String, IWin32Window, Point) Method与GetPostitionFromCharIndex相结合

所以你从GetPostitionFromCharIndex中获得Point文本并将其传递给ToolTip.Show