Search code examples
c#wpfpopupnotifyicon

How to solve WPF Popup Notify in taskbar to rightbottom of the screen in c#?


I stuck on WPF popup notifyicon in taskbar,it does not show the popup notification on the screen. Am tried the below code in c#

 public void report()
 {
  //Here am selected the value from database and stored it in "str" ,upto 
       //this working fine
  string title = "Report Received";
  string str = value from database

  NotifyIcon nic = new NotifyIcon();
  nic.Text = str;                  
  nic.BalloonTipText = str;
  nic.BalloonTipTitle = title;
  nic.Visible = true;
  nic.ShowBalloonTip(1000, title, text, ToolTipIcon.Info);
}

how to work this perfectly,am stuck here


Solution

  • You need to define an icon before call ShowBalloonTip to get this working:

    nic.Icon = new Icon(@"PATH/TO/AN/ICON.ico");
    

    Hope this helps