public Form1() { InitializeComponent(); NotifyItem Notifycation = new NotifyItem(); Notifycation.Notify(); DateTimes = "23:00"; timer1.Interval = 1000; timer1.Enabled = true; }
private void Timer1_Tick(object sender, EventArgs e) { string pickTime = DateTime.Now.ToShortTimeString(); if (notifycount == 0) { if (pickTime == DateTimes) { NotifyItem Notifycation = new NotifyItem(); Notifycation.Notify(); notifycount = 1; } } if (pickTime != DateTimes) { notifycount = 0; } }