Program.cs code -
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
For Form1
public Form1()
{
InitializeComponent();
var displayIcon = new NotifyIcon();
displayIcon.Icon = SystemIcons.Information;
displayIcon.BalloonTipText = "test";
displayIcon.Visible = true;
displayIcon.ShowBalloonTip(3000);
displayIcon.Click += DisplayIcon_Click;
displayIcon.BalloonTipClicked += DisplayIcon_BalloonTipClicked;
}
private void DisplayIcon_BalloonTipClicked(object sender, EventArgs e)
{
// throw new NotImplementedException();
}
private void DisplayIcon_Click(object sender, EventArgs e)
{
// throw new NotImplementedException();
}
The event DisplayIcon_BalloonTipClicked is raised when ballon notification appears on desktop for 3 seconds. But if the notification goes to the action center, even if the app is running, the event is not raised. Please suggest what is wrong here.