【问题标题】:How to show a .NET Balloon ToolTip?如何显示 .NET 气球工具提示?
【发布时间】:2012-01-03 18:27:31
【问题描述】:

如何在 WinForms 中显示IsBalloon 工具提示

我现在试试:

ToolTip hint = new ToolTip();
hint.IsBalloon = true;
hint.ToolTipCaption = "Hello, world!";
hint.ToolTipIcon = ToolTipIcon.Error;
hint.Show("Please create a world.", myTextBox, 0, 0);

不幸的是,气球没有指向 (0, 0)(相对于控件),而是显示在 (0,0)(相对于控件):

显示 .NET Balloon ToolTip 的正确方法是什么?

【问题讨论】:

  • 你看过this相关的问题吗?
  • 从句子中不清楚“不幸的是,气球没有指向相对于控件的 (0, 0),而是显示在相对于控件的 (0,0)控制。”哪个控件,ToolTip 还是 TextBox?
  • @M.Babcock 我没有看到这个问题;尽管这个问题无关紧要。

标签: .net winforms tooltip


【解决方案1】:

已知错误。调用两次,第一次为空:

toolTip.Show(string.Empty, myTextBox, 0);
toolTip.Show("Please create a world.", myTextBox);

来自How do I make a tooltip point at a specific label in C#?

【讨论】:

【解决方案2】:

你的最后一行应该是。 Mouse_hove 动作。

回答 hint.Show("Hello", Me, Me.PointToClient(New Point(0, 0)), 5000) '------------------------

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-09-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-11
    • 1970-01-01
    相关资源
    最近更新 更多