Colonel_Custard
Colonel_Custard

Reputation: 1390

Why isn't my NotifyIcon showing up?

I'm trying to get a notifyIcon to show a BalloonTip, but it won't show up when I press the button

 private void button1_Click(object sender, EventArgs e)
 {                                    
       OsWatchNotify.Visible = true;
       OsWatchNotify.BalloonTipText = "Example";
       OsWatchNotify.BalloonTipTitle = "example title";
       OsWatchNotify.ShowBalloonTip(1);                          
 }

any and all help would be appreciated.

Upvotes: 31

Views: 19002

Answers (6)

SoftwareCreations
SoftwareCreations

Reputation: 33

If you don't import an icon is another reason. Unfortunately a default icon isn't used to let you know if you forget to import one in properties or declare an icon in code. You would think there would be a default image but there isn't. To fix this the obvious answer is to declare the path to the icon in code or just import one from properties.

Upvotes: 1

bouvierr
bouvierr

Reputation: 3791

On my Win10 PC, the icon showed up for a split second in the tray area before disappearing. I couldn't see the balloon tip at all. My first reaction was to go to Taskbar Settings > Turn system icons on or off and enable it for my application. But that didn't help.

The balloon tip was actually hidden because of Focus Assist, which turns on by default "When I'm using an app in full screen mode"! After unchecking that, the balloon tip is now visible!

Upvotes: 1

Goodies
Goodies

Reputation: 2069

The acknowledged answer is accurate. When your icon is invalid, it will not show up.

To keep a tray icon visible, the user should drag it from the Hidden Icons popup to the visible Tray part.

When the user does not do that, there are also some nasty pitfalls with the notifyIcon.Visible property. When the notifications set in the Windows tray settings do not include your App, the Icon will only show up once, the first time you set Visible=true.

When you set notifyIcon.Visible to false, your icon will be removed, but it will not reappear in the visible Tray part on the Tray, when Visible is set to true again. It will become a hidden tray icon instead.

To prevent issues, set a valid Icon and set Visible=true only once at the start.. to show alarms or other things, change the notifyIcon.Icon

Upvotes: 1

Sujeet Shrestha
Sujeet Shrestha

Reputation: 21

This was the fix in Windows 10:

  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.

Perhaps, code it to check the registry and/or notify user..

Upvotes: 2

Hans Passant
Hans Passant

Reputation: 941485

There are not that many ways to fumble a NotifyIcon. Except one, if you forget to set its Icon property then it will never show up. Ought to raise an exception but that was overlooked.

Upvotes: 62

Jim Culverwell
Jim Culverwell

Reputation: 2813

If you are using Windows 10 go to Settings > System > Notifications & actions and make sure notifications are switched on for your app. Also make sure 'quiet hours' is not on.

Upvotes: 4

Related Questions