void NotifyIconPlace() //иконка в трее запуск проверки обновлений и добавление событий { notificationM.ContextMenuStrip = contextMenuICon; notificationM.DoubleClick += NotificationM_DoubleClick; notificationM.Visible = true; var r = new Thread(() => { string Ver = checkUpd.MsgUpdateAvailable(); if (Ver != null) { if (InvokeRequired) { buttontest.Invoke(new Action(() => buttontest.Visible = true)); } else { buttontest.Visible = true; } notificationM.ShowBalloonTip(3000, "Update available " + Ver, "Click on this notification to see more", ToolTipIcon.Info); notificationM.BalloonTipClicked += NotificationM_BalloonTipClicked; isLast = false; } }); r.IsBackground = true; r.Start(); }
private void Form1_Load(object sender, EventArgs e) { panelSettings.Location = new Point(200, 380); labelVer.Text = Application.ProductVersion + " by IronShell"; chkupd = new EzShell.CheckUpdates( Application.ProductName, Application.ProductVersion, "/Files/PicSorter.zip", msgMaker, progss, nfIc, labelStatus); nfIc = new NotifyIcon() { Icon = Properties.Resources.PICSORT1, Text = "Image Sorter by IronShell" }; var chupdt = new Thread(() => { string Ver = chkupd.MsgUpdateAvailable(); if (Ver != null) { nfIc.Visible = true; nfIc.BalloonTipClicked += NfIc_BalloonTipClicked; nfIc.ShowBalloonTip(3000, "Update available " + Ver, "PicSorter by IronShell", ToolTipIcon.Info); Thread.Sleep(5000); nfIc.Visible = false; nfIc.Dispose(); } }) { IsBackground = true }; chupdt.Start(); }