【问题标题】:"Speech bubble" notifications“语音气泡”通知
【发布时间】:2009-02-27 02:55:30
【问题描述】:

我正在尝试获取通知以在 MFC 应用程序中弹出类似这些气泡的内容:


(来源:humanized.com

我目前正在用 C# 制作一个界面模型,以向一些利益相关者展示,所以如果有它也很好。

不一定非得是气泡式的:它可能是类似工具提示的东西 - 但它必须在没有鼠标悬停的情况下出现

干杯!

【问题讨论】:

    标签: c# .net c++ mfc notifications


    【解决方案1】:

    刚刚在 CodeProject 上找到 this。下载了示例,它实际上运行良好。我将把它添加到我自己的代码库中;永远不知道我什么时候需要这个!

    【讨论】:

      【解决方案2】:

      看看CodeProject (C#) :)

      【讨论】:

        【解决方案3】:

        这是一种标准的 Windows 机制(自 XP 起),它们被称为 Balloon Tooltips。根据您想要显示气球的位置,您可以使用CEditShowBalloonTip 方法或Shell_NotifyIcon API。

        Windows 窗体中有 NotifyIcon 类,但我不知道 TextBox,您可能必须使用互操作。

        【讨论】:

        • 这似乎不起作用 - 可能是因为我在 VS2005 下?
        • 是的,可能 CEdit 的 ShowBalloonTip 可能已经在 VS2008 中引入。您可以使用 CEdit 的 HWND 并在纯 API 中执行此操作。有一个 Edit_ShowBalloonTip 宏。
        【解决方案4】:

        您可以只使用 System.Windows.Forms.ToolTip。

        using System.Windows.Forms;
        
        ...
        
        ToolTip myTip = new ToolTip; // create tooltip
        myTip.IsBaloon = true; // give it a round shape
        myTip.SetToolTip( myTool, "You're hovering above myTool." ); // register popup message for 'myTool'
        ...
        myTip.Show(myTool, "Forced modal pop-up.", 1000 ); // display pop up message for 1 sec at 'myTool'
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2011-12-19
          • 2021-09-18
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多