NotifyIcon not showing balloon tip

otalado

New member
Joined
May 19, 2022
Messages
3
Programming Experience
Beginner
I've tried to minimize my app to tray and use NotifyIcon to display the balloon info about it. Since the balloon tip did not show, I assumed that I am doing something wrong, so I made a very basic app to test that with examples that I found and try to figure out what I am doing wrong. Even that examples do not work for me. I found that there are cases when the balloon tip won't show (NotifyIcon.ShowBalloonTip Issues : C# 411). To the best of my knowledge, none of the conditions when the balloon won't show are satisfied. I even tried the .NET 4.8.1 instead of the NET6 (just in case there are some differences between them. I could easily work around it by creating a popup window, but I really would like to find out what I'm doing wrong. I add the code of the very minimal test app below (it all works as expected, except that the balloon tit does not work):

NotifyTest:
namespace NotifyTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            notifyIcon1.Visible = true;
        }

        private void Form1_SizeChanged(object sender, EventArgs e)
        {
            if (this.WindowState == FormWindowState.Minimized)
            {
                notifyIcon1.Icon = SystemIcons.Exclamation;                
                notifyIcon1.BalloonTipText = "Minimized to tray";
                notifyIcon1.ShowBalloonTip(1000);
                this.ShowInTaskbar = false;
            }
            else if (this.WindowState == FormWindowState.Normal)
            {
                notifyIcon1.BalloonTipText = "We're back";
                notifyIcon1.ShowBalloonTip(1000);
            }
        }

        private void notifyIcon1_DoubleClick(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Normal;
        }
    }
}
 
Tested the code with .Net 6 on Windows 10 and 11 (22H2), I get correct notifications on both systems.

How about your settings for Notification Center - are app notifications enabled? Is Do Not Disturb turned on? (I think it is Action Center and Focus Assist in Win10)
 
Auch! You are right, the notification settings were messed up! I generally don't touch those, so it did not occur to me to check them. Turns out I was fixing things that were not broken. Again!
Thanks for your help!
 
Back
Top Bottom