void timer_Tick(object sender, EventArgs e) { Visible = !Visible; BlinkCounter++; if (BlinkCounter > 7) { BlinkTimer.Stop(); } }
private void SetImage(Image img, bool blink = false) { BlinkTimer.Stop(); Visible = true; BlinkCounter = 0; Image = img; if (blink) { BlinkTimer.Start(); } }
// СТОП private void StopTimer() { MainTimer.Stop(); BlinkTimer.Stop(); DisableControlls(false); IsRunning = false; //numHours.Value = TimeStart.H; //numMinutes.Value = TimeStart.M; //numSecond.Value = TimeStart.S; //dTPicker.Value.Second dTPicker.Value = new DateTime(2015, 04, 24, TimeStart.H, TimeStart.M, TimeStart.S); }
public frmMonitor() { InitializeComponent(); // timer config DataTimer.Interval = int.Parse(ConfigurationManager.AppSettings["RefreshTimer"]) * 1000; dataManager = new DataManager(_ConnectionString); //dataManager.RepairDataLogger(); arrObj.Clear(); BlinkTimer.Stop(); }
// КЛИК ПО ИКОНКЕ В ТРЕЕ private void notifyIcon1_MouseClick(object sender, MouseEventArgs e) { // остановить моргание BlinkTimer.Stop(); // скрыть иконку notifyIcon1.Visible = false; // Отбразить форму this.Show(); // развернуть окно this.WindowState = FormWindowState.Normal; }
// ТАЙМЕР МОРГАНИЯ private void BlinkTimer_Tick(object sender, EventArgs e) { BlinkTimer.Stop(); if (IconRed) { notifyIcon1.Icon = SimpleTimer.Properties.Resources.clockgreen; } else { notifyIcon1.Icon = SimpleTimer.Properties.Resources.clockred; } IconRed = !IconRed; BlinkTimer.Start(); }
private void BlinkTimer_Tick(object sender, EventArgs e) { if (i++ >= 16)// || obj=="") { //if (idx < arrObj.Count) //{ // obj = arrObj[idx++].ToString(); //} //else //{ BlinkTimer.Stop(); //obj = ""; //idx = 0; arrObj.Clear(); //} i = 0; } //obj = arrObj[idx++].ToString(); foreach (string obj in arrObj) { this.select_blink(obj); } }