Reputation: 310
I have a notifyIcon that I want to use in WinForms app, to show balloonTips to the user on certain events / issues.
It worked fine, and then I made changes to the application that I cannot see could have influenced the workings of the BalloonTip, but now the balloonTip does not pop up.
The NotifyIcon.Icon appears in the task bar and if you keep looking at the taskbar you briefly see the icon in there (like it flashes), but the actual BalloonTipText and title don't appear
here is the code I am using.
private void SetBalloonTip(String BalloonMessage, bool isError)
{
AppTips.Icon = SystemIcons.Exclamation;
AppTips.BalloonTipTitle = "Attention";
AppTips.BalloonTipText = BalloonMessage;
AppTips.Visible = true;
if (isError)
{
AppTips.BalloonTipIcon = ToolTipIcon.Error;
}
else
{
AppTips.BalloonTipIcon = ToolTipIcon.Info;
}
AppTips.ShowBalloonTip(300000);
}
whenever I want to show a BalloonTip Message I call the above method.
I have played around with the timeout as I read on other threads it could be a possible issue, but increasing nor decreasing it made any difference. I also added Thread.Sleep before calling the SetBalloonTip method, thinking that maybe the method is called too quickly in succession, but that did not make a difference either.
Upvotes: 1
Views: 565
Reputation: 39072
There are limits on the length of BalloonTipText
and BalloonTipTitle
on some versions of Windows (but not on others, Windows 10 supports any length for example):
NotifyIcon.BalloonTipText
max length of 255 characters NotifyIcon.BalloonTipTitle
max length of 63 charactersMake sure your text does not violate these limitations to have it display properly.
Upvotes: 2