0
this.WindowState = FormWindowState.Minimized;

notifyIcon1.BalloonTipIcon = ToolTipIcon.Info;
notifyIcon1.BalloonTipTitle = "Notify Icon Test Application";
notifyIcon1.BalloonTipText = "You have just minimized the application." + Environment.NewLine + "Right-click on the icon for more options.";

notifyIcon1.ShowBalloonTip(5000);

I'm using this code in a button in order to minimize the form and pop up a notification. The form is minimizing but no notification is shown. Any help?

Kyle Trauberman
  • 25,414
  • 13
  • 85
  • 121
Ali Jaber
  • 133
  • 1
  • 12
  • I added the winforms tag, as this looks like winforms code, but If I'm wrong, please edit the tags. – Kyle Trauberman Jan 05 '16 at 18:24
  • 1
    Possible duplicate of [Show a Balloon notification](http://stackoverflow.com/questions/13373060/show-a-balloon-notification) – sab669 Jan 05 '16 at 18:31

1 Answers1

3

You need to give that NotifyIcon an Icon. You only set the icon for the tooltip.

This msdn article explains how you can add icons to your project's resources. If you create or add an icon named myIcon you can use it for your NotifyIcon like this:

notifyIcon1.Icon = Resources.myIcon;
// and to be sure set it visible
notifyIcon1.Visible = true;

The static class Resources is normally created in the namespace <yourprojectnamespace>.Properties.

René Vogt
  • 43,056
  • 14
  • 77
  • 99