10

I use the ShowBalloonTip method of a TrayIcon class to display a balloon tip. Is there a way to handle a click over this balloon?

When I click over the balloon, no event seem to be generated, and it only closes the balloon.

Mat
  • 202,337
  • 40
  • 393
  • 406
ariel
  • 15,620
  • 12
  • 61
  • 73
  • When you say "click over" the balloontip do you mean *on* the balloontip or over it as in some other part of the desktop other than the balloontip? – Peter Kelly Jul 05 '10 at 20:52

2 Answers2

22

I think you mean NotifyIcon . Use following pattern...

NotifyIcon notifyIcon = null;
public Form1()
{
    InitializeComponent();
    notifyIcon = new NotifyIcon();
    // Initializing notifyIcon here...
    notifyIcon.BalloonTipClicked += new EventHandler(notifyIcon_BalloonTipClicked);
}

void notifyIcon_BalloonTipClicked(object sender, EventArgs e)
{
    // Operation you want...
}

I hope it feed your needs...

Jalal
  • 6,594
  • 9
  • 63
  • 100
1

Have you tried the following snippet? I managed to find it whilst doing a quick google search:

private void TrayNotifyIcon_BalloonClick(object sender, EventArgs e)
{
    //Perform Action
}

Obviously you'll need to make sure you specify the correct name in the method signature for your own application.

I think this was written in an older version of the .Net Framework and there's probably a newly named method for it.

Source: Build a C# Notification System

Jamie Keeling
  • 9,806
  • 17
  • 65
  • 102