/// <summary> /// Handles the Timer and calls pop-up Message Box /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void OnTimer(object sender, ElapsedEventArgs e) { if (!isPaused) { // Start the timer try { this.clockTime++; //Pop up if (this.clockTime == this.alarmTime) { // When Timer is done display a pop up baloon message using (ProcessIcon pi = new ProcessIcon()) { pi.PopUpBaloon(); //Reset the timer so it will call again // WARNING! This will cause it to create a bunch of message boxes if I don't stop it ResetTimer(); } } } catch (Exception ex) { MessageBox.Show("OnTimer(): " + ex.Message); } } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Show the System tray icon using (ProcessIcon pi = new ProcessIcon()) { pi.Display(); // Make sure application runs Application.Run(); } }