I need a timer that will change the text of a combobox which is binded to a database.
My Application which is based on hospital management wherein a doctor has to visit rooms within 6 hours. If 6 hours elapse the combo should show "need......" and if not something "......" and the changes should be also written in the database as there are many rooms. there should also be a button that resets the timer. please help me. Thank you so much

I need a timer that will change the text of a combobox which is binded to a database.
My Application which is based on hospital management wherein a doctor has to visit rooms within 6 hours. If 6 hours elapse the combo should show "need......" and if not something "......" and the changes should be also written in the database as there are many rooms. there should also be a button that resets the timer. please help me. Thank you so much

There is a timer that you can add to your application, just drag it from the toolbox to anywhere on your application.

private void timer1_Tick(object sender, EventArgs e)
{
//Code to be executed
}

Double click it and add the code to be executed when it ticks. you can set how long between each tick by setting the interval property of the timer, this is an int and holds the time in ms between each tick so for 6 hours you would need 21,600,000 as the value.

//set timer to tick every 10seconds
timer1.Interval = 10000

there are also methods for starting and stopping the timer.

Hope this helps

Edited 6 Years Ago by midimatt: n/a

This article has been dead for over six months. Start a new discussion instead.