Search code examples
c#winformsnotifyicon

NotifyIcon does not display


I'm trying to display a notifyIcon but it's not working.

Why does nothing appear?

public void notify_icon(string text, string title)
{
    var notify = new NotifyIcon() 
    {
        Icon = this.Icon,
        BalloonTipIcon = ToolTipIcon.Info,
        BalloonTipTitle = title,
        BalloonTipText = text,
    };
    notify.ShowBalloonTip(2000);
}

Solution

  • Set Visibility true. Reference NotifyIcon Class

    var notify = new NotifyIcon() 
        {
            Icon = this.Icon,
            BalloonTipIcon = ToolTipIcon.Info,
            BalloonTipTitle = title,
            BalloonTipText = text,
            Visible = true,
        };