Hello,
I am writing a C# program that uses WinForms. In the past, I have written programs that
measure voltages or other parameters from sensors and put them on a timer read. This worked well when needing to access this data in a single form.
But now, I have a situation where I need to be able to have the timer running all of the time, regardless of what form I am on. There could be 4 or 5 forms in my program.
I tried to put the timer in my MainForm, but that did not work very well, as I had to create another instance of MainForm, and that threw off the timers.
What I need is a method to be able to have a process or form running all of the time, and only create a single instance of it.
Can anyone point me to some information or code which explain a better method of what I'm trying to do?
Thanks
Loading
Glenn PattonPosted Jun 22, 2012, 11:29 AM
Sam HobbsPosted Jun 22, 2012, 10:28 AM
In this situation, the question is vague. I assumed that the timer is being used to do something periodically; in other words, some IO is initiated by a timer. In other words, it could be that neither the sensor nor the computer with the timer are doing anything and then a timer is used so that the computer knows to check the sensor. If that is what is being done then it is a valid use of a timer.
Glenn PattonPosted Jun 22, 2012, 10:10 AM
Glenn
Sam HobbsPosted Jun 8, 2011, 3:16 AM
FroglegPosted Jun 7, 2011, 5:32 PM