System.Threading.Timer timer = new System.Threading.Timer(timerDelegate, autoEvent, new TimeSpan(0, 0, 0), new TimeSpan(0, 0, 0, 0, -1));
now when i am trying to support this application in task bar, using notifyIcons --- whenever i try to close the app, the icon doesn't go away and the application keeps on running in task manager, untill i again click on icon (just clicking on icon serves, no need to select any option)
Actually the timers are running as below, cause i want them to run continuosly with doing some calculation every 12 hours
Expand|Select|Wrap|Line Numbers
- private void Form1_Load(object sender, EventArgs e)
- {
- while (true)
- {
- if (x == 0)
- {
- System.Threading.Timer timer = new System.Threading.Timer(timerDelegate, autoEvent, new TimeSpan(0, 0, 0), new TimeSpan(0, 0, 0, 0, -1));
- autoEvent.WaitOne();
- x++;
- }
- else if (x == 1)
- {
- System.Threading.Timer timer = new System.Threading.Timer(timerDelegate, autoEvent, new TimeSpan(12, 0, 0), new TimeSpan(0, 0, 0, 0, -1));
- autoEvent.WaitOne();
- }
- }
- }