在我的应用程序中,我想使用工具提示指向标签以引起用户注意:
toolTip.IsBalloon = true;
toolTip.Show("message", label1);
问题是气球没有指向指定的标签。我该怎么办?
在我的应用程序中,我想使用工具提示指向标签以引起用户注意:
toolTip.IsBalloon = true;
toolTip.Show("message", label1);
问题是气球没有指向指定的标签。我该怎么办?
这是一个已知的错误。
尝试调用它两次以解决黑客问题:
toolTip.Show(string.Empty, label1, 0);
toolTip.Show("message", label1);
你可以做这样的事情......更具体(即)工具提示将显示多长时间......
当鼠标离开
public class MouseLeave
{
public void mouseLeave(Label label1, ToolTip ttpTemp)
{
ttpTemp.Hide(label1);
}
}
当鼠标进入
public class MouseOver
{
public void mouseOver(Label label1, ToolTip ttpTemp)
{
ttpTemp.AutoPopDelay = 2000;
ttpTemp.InitialDelay = 1000;
ttpTemp.ReshowDelay = 500;
ttpTemp.IsBalloon = true;
ttpTemp.SetToolTip(label1, "Message1");
ttpTemp.Show("message1", label1,label1.width,label1.height/10,5000);
}
}
Tooltip 与 MouseHover 和 MouseLeft 一起工作 [想象一下这样] 如果鼠标经过 Label,则会显示 tooltip,当鼠标离开时,tooltip 会消失。
并且代码应该是:
ToolTip t = new ToolTip();
t.IsBalloon = true;
t.ToolTipTitle = "Title";
t.SetToolTip(label1, "Text");
只是 ToolTipTitle 是可选的 :)