G
georgie1909
Guest
I have created a notification, Balloon Tip. However the event listener only fires when the notification is new (with the action center already opened or when clicking the the balloon tip when it comes up).
Below is what I wish to be called. The event "click" also is directed to this block.
It seems although the listener for the notification is stopped when the notification has closed?
private void NotifyIcon1_BalloonTipClicked(object sender, EventArgs e)
{
string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
//MessageBox.Show("1");
PopUpWindow popUpWindow = (PopUpWindow)Application.OpenForms["PopUpWindow"];
if (popUpWindow != null)
{
popUpWindow.pc = pc;
popUpWindow.AddToList();
if (popUpWindow.WindowState == FormWindowState.Minimized)
popUpWindow.WindowState = FormWindowState.Normal;
popUpWindow.Show();
}
else
{
popUpWindow = new PopUpWindow();
popUpWindow.pc = pc;
popUpWindow.AddToList();
popUpWindow.Show();
}
}
Here is how the notification is created:
if (n != null)
{
n = new Notifications();
n.pc = this;
n.CreateNotification(1000, dno.Message, dno.Detail);
}
else
{
n = new Notifications();
n.pc = this;
n.CreateNotification(1000, dno.Message, dno.Detail);
}
public void CreateNotification(int time, string title, string message)
{
notifyIcon1.Visible = true;
notifyIcon1.ShowBalloonTip(time, title, message, ToolTipIcon.Info);
}
Continue reading...
Below is what I wish to be called. The event "click" also is directed to this block.
It seems although the listener for the notification is stopped when the notification has closed?
private void NotifyIcon1_BalloonTipClicked(object sender, EventArgs e)
{
string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
//MessageBox.Show("1");
PopUpWindow popUpWindow = (PopUpWindow)Application.OpenForms["PopUpWindow"];
if (popUpWindow != null)
{
popUpWindow.pc = pc;
popUpWindow.AddToList();
if (popUpWindow.WindowState == FormWindowState.Minimized)
popUpWindow.WindowState = FormWindowState.Normal;
popUpWindow.Show();
}
else
{
popUpWindow = new PopUpWindow();
popUpWindow.pc = pc;
popUpWindow.AddToList();
popUpWindow.Show();
}
}
Here is how the notification is created:
if (n != null)
{
n = new Notifications();
n.pc = this;
n.CreateNotification(1000, dno.Message, dno.Detail);
}
else
{
n = new Notifications();
n.pc = this;
n.CreateNotification(1000, dno.Message, dno.Detail);
}
public void CreateNotification(int time, string title, string message)
{
notifyIcon1.Visible = true;
notifyIcon1.ShowBalloonTip(time, title, message, ToolTipIcon.Info);
}
Continue reading...