public void ShowNotification(String title, String ballonText, Icon icone) { //NotifyIcon notifyIcon = new NotifyIcon(); NotifyIcon notifyIcon = NotificationManager.NotifyIcon; notifyIcon.Visible = true; notifyIcon.BalloonTipTitle = title; notifyIcon.BalloonTipText = ballonText; notifyIcon.Icon = icone; notifyIcon.ShowBalloonTip(1000); notifyIcon.BalloonTipClicked += notifyIcon_Click; notifyIcon.Click += notifyIcon_Click; notifyIcon.MouseClick += notifyIcon_Click; if (FormMostraOutput == null) { FormMostraOutput = new FormMostraOutput(); } Thread t = new Thread(() => { Thread.Sleep(3500); //notifyIcon.Dispose(); notifyIcon.Visible = false; }); t.Start(); }
private void listBoxLog_DoubleClick(object sender, EventArgs e) { FormMostraOutput formMostraOutput = new FormMostraOutput(); formMostraOutput.richTextBoxOutput.Text = listBoxLog.SelectedItem.ToString(); formMostraOutput.Show(); }
static void notifyIcon_Click(object sender, EventArgs e) { if (FormMostraOutput != null) { FormMostraOutput.richTextBoxOutput.Text = ((NotifyIcon)sender).BalloonTipText; FormMostraOutput.ShowDialog(); FormMostraOutput = null; } }