0

I have a notifyicon on my application and trying to show a ballontip, that works fine on Windows 7 and Windows 8.1, but i can't make it work in Windows 10.

Tried editing registry, increasing timeout, setting balloon tip icon and disabling notification as toasts.

This is how the component is initialized:

private void InitializeComponent()
  {
  // notifyIcon1
  // 
  this.notifyIcon1.ContextMenuStrip = this.trayMenu;
  this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
  this.notifyIcon1.Visible = true;
  this.notifyIcon1.BalloonTipClicked += new System.EventHandler(this.notifyIcon1_BalloonTipClicked);
  this.notifyIcon1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDoubleClick);

And this is how i try to show de balloon tip:

    void hideToTray()
{
  notifyIcon1.BalloonTipTitle = SerialDevMan;
  notifyIcon1.BalloonTipText = "Double-click to restore";

  notifyIcon1.Visible = true;
  notifyIcon1.ShowBalloonTip(2000);
  this.Hide();
}

EDIT:

After all day trying i found a solution.

I created a new notifyicon tool called now "notifyicon2" and copied all the code to the new icon and it worked. But when i deleted the first one the second stopped working... recovering the first one did not made the second work again.

Created a new notifyicon, did all again and it is working as long as I keep another icon not visible on the form.

Perhaps it is a windows 10 bug, or is something that i cannot see now, i will keep my project like that for now.

  • [Enable balloon notifications in Windows 10 using a Registry tweak](https://winaero.com/blog/enable-balloon-notifications-in-windows-10-using-a-registry-tweak/) – stuartd Mar 26 '18 at 20:21
  • Vinicius, were you able to get it working ?? – Clint Mar 27 '18 at 18:21
  • You should write your solution as an answer. Shouldn't have to read an an answer that has a comment that refers back to the (edited) question for the answer. – Stealth Rabbi May 07 '18 at 12:55
  • If you read the comment, you will see that i didn't changed the code, it is still the same. – Vinicius Moreira May 08 '18 at 11:36

2 Answers2

0

Neither of these solved my issue :(

But by accident I fixed it! My problem was I had my project configured for 32-bit on a 64-bit platform and for whatever reason they only show up when when I run the project for Any CPU (64-bit in this case)!!

Hopefully that helps some of you, it was a real mystery for me...

tkefauver
  • 491
  • 5
  • 19
0

Change the Solution Configuration "Debug mode to Release mode" with X64 or X32 Solution platform. It will start work.

public static NotifyIcon trayIcon;
 trayIcon = new NotifyIcon();
 trayIcon.Icon = new Icon("Images/Test.ico");
 trayIcon.Visible = true; trayIcon.Text=Path.GetFileNameWithoutExtension(AppDomain.CurrentDomain.FriendlyName);
 ContextMenu contextMenu1 = new ContextMenu();
contextMenu1.MenuItems.Add("Menu2", Menu2_Event);
contextMenu1.MenuItems.Add("Menu3", Menu3_event);
contextMenu1.MenuItems.Add("Exit", Close_Click);
trayIcon.ContextMenu = contextMenu1;
trayIcon.BalloonTipText = "Hi Test";
trayIcon.ShowBalloonTip(1000);