0

I am trying to show a message on loading of the application. I am trying to implement this using the Windows notifyIcon tool. Below is the method I implemented and calling this in the form load. However no message is being shown when opening my application.

private void Displaynotify()
    {
        try
        {
            //notifyIcon1.Icon = new System.Drawing.Icon(Path.GetFullPath(@"image\graph.ico"));
            notifyIcon1.Text = "Finance - Treasury Ticket Notification";
            notifyIcon1.Visible = true;
            notifyIcon1.BalloonTipTitle = "Welcome, you have 3 Pending Tickets.";
            notifyIcon1.BalloonTipText = "Click Here to see details";
            notifyIcon1.ShowBalloonTip(100);
        }
        catch (Exception ex)
        {

        }
    }


private void Form1_Load(object sender, EventArgs e)
    {
        Displaynotify();
    }
nvoigt
  • 75,013
  • 26
  • 93
  • 142
  • 2
    Why is the first line commented out and why do you have an empty catch block that swallows the very error messages you would need to diagnose your problem? – nvoigt Oct 23 '17 at 07:31
  • Doing it in formload maybe too soon - formload often eats errors anyway.. – BugFinder Oct 23 '17 at 07:32
  • Yeah, that code is fishy. Do make sure you can actually see the icon in the notification area. Then keep in mind that NotifyIcon observes the [EnableBalloonTips user preference](https://support.microsoft.com/en-us/help/307729/how-do-i-disable-balloon-tips-in-the-notification-area-in-windows-xp-o) – Hans Passant Oct 23 '17 at 10:42

0 Answers0