繁体   English   中英

出现2-3次后,工具提示不出现

[英]Tooltip does not come up after showing up 2-3 times

我正在像这样使用Tooltip类...

其中ctrl是图片ctrl。

ToolTip oTooltip =新的ToolTip(); oTooltip.SetToolTip(ctrl,“算法已成功完成”); oTooltip.ShowAlways = true;

加载表单后,将显示工具提示...每当我将鼠标悬停在工具提示上时,它就会显示大约2到3次,但是从第四次悬停起,它就会停止显示/显示。

我需要设定什么吗?

不久前,我遇到了类似的问题。 要变通解决此问题,我订阅了控件的MouseEnter事件,并在将ToolTipActive属性从falsetrue之间切换。 我的代码看起来像这样:

using System;
using System.Windows.Forms;

public Form1()
{
    this.pictureBox1.MouseEnter += new EventHandler(pictureBox1_MouseEnter);

    this.ToolTip = new ToolTip();
    this.ToolTip.SetToolTip(this.pictureBox1, "The algorithm has been completed successfully.")
}

private ToolTip ToolTip
{
    get;
    set;
}

private void pictureBox1_MouseEnter(object sender, EventArgs e)
{
    this.ToolTip.Active = false;
    this.ToolTip.Active = true;
}

希望能有所帮助。

暂无
暂无

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

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