Search code examples
c#windowspopupclickballoon

Balloontip how can I catch a click C#


I'm trying to create a balloontip (windows popup) and want to know if the user clicks on it. But I can't catch the click.

I've already tried a few things but it won't work.

notification.ShowBalloonTip(5000);          
notification.BalloonTipClicked += new System.EventHandler(this.OpenWindow);
notification.Click += new System.EventHandler(this.OpenWindow);
notification.DoubleClick += new System.EventHandler(this.OpenWindow);

The notification is a NotifyIcon object. I hope someone here can help me with this.


Solution

  • There where multiple things I had to do. I needed notification.BalloonTipClicked to verify I've clicked on the balloon.

    Also, afther that line of code I had a notification.dispose function to remove the icon. But this was comming to fast, so the notification was disposed before I could click on it.

    The solution to save that problem was to set the visibility to false.

    After that it worked fine!