简体   繁体   中英

Tooltip does not come up after showing up 2-3 times

I am using the Tooltip class like this...

where ctrl is a Picture ctrl.

ToolTip oTooltip = new ToolTip(); oTooltip.SetToolTip(ctrl, "The algorithm has been completed successfully"); oTooltip.ShowAlways = true;

When the form is loaded, teh tooltip is shown... it shows up some two or three time whenever i hover the mouse obver it but from the fourth hover it stops coming/sghowing.

is there anything that i need to set.?

I had a similar issue not too long ago. To work around the problem, I subscribed to the control's MouseEnter event and toggled between setting the Active property of the ToolTip from false to true . My code looked something like this:

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;
}

Hope that helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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