简体   繁体   中英

App Won't Show Balloon Tip

I am writing a VB.NET application in VS2017, to run on Windows 10. I want the main (and only) Form to minimize down to a System Tray icon. That part I have working fine. The next part, display a Balloon Tip popup notification (eg, "Application is still running"), is not working at all.

I have already checked/noted the following:

  • The NotifyIcon object has an icon assigned to it in the designer grid as well as in the vb.net code-behind for the form, as does its associated BalloonTipIcon member/property
  • The Group Policy on the the machine does not appear to forbid the use of Balloon Tips
  • Balloon tips do not appear to be disabled in the registry
  • The program works as expected in Windows 8.1 Pro and displays the BalloonTip, but does not in Windows 10 Enterprise N 2016 LTSB.

The machine is located in a domain that does have Group Policy administration going on, however the resultant policy set found on my machine does not seem to indicate that balloon tips have been disabled.

Copying-and-pasting exact code from StackOverflow does not work. The problem must then be in the system itself.

This is the code (which works on W8.1 but not W10):

Private Sub frmMain_Resize(sender As Object, e As EventArgs) Handles Me.Resize

    Try

        If Me.WindowState = FormWindowState.Minimized Then

            NotifyIcon1.Visible = True
            NotifyIcon1.Icon = SystemIcons.Application
            NotifyIcon1.BalloonTipIcon = ToolTipIcon.Info
            NotifyIcon1.BalloonTipTitle = "App Title"
            NotifyIcon1.BalloonTipText = "The App is still open!"
            NotifyIcon1.ShowBalloonTip(50000)
            ShowInTaskbar = False

        End If

    Catch ex As Exception

        ErrorHandler(ex)

    End Try

End Sub

Where else can I look?

Cross-posted on SuperUser

So it turns out I fell for one of the oldest tricks in the book. I needed to do a full reboot after altering one the registry keys.

So, for me, making Balloon Tips appear in Windows 10 needed the following:

  1. Open regedit.exe

  2. Navigate to HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced

  3. Set (or add) EnableBalloonTips (as REG_DWORD) and set value to 1

  4. Reboot.

Voilà. Problem solved.

我发现即使我在代码中声明了图标,我也必须最初向 notifyIcon1.icon 属性添加一个图标。

In my case David Mancini response was not enough, I also had to enable "Get notifications from apps and other senders" under Settings -> System -> Notifications & actions 在此处输入图片说明

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