Hi there, I'm currently working on a C# application that deals with dynamically created TabPages based (each TabPage represents a file that has been opened).
On each TabPage there is a DataGridView control as well as some other items including a Button whose purpose is to start/stop a timer clock of sorts. The main problem here is that all of my controls are dynamically generated, so if there were 3 TabPages open, there would be 3 different Button controls saying "Start/Stop Timer", each one with a unique .Name property based on the filename. So, I can reference these controls easily using methods to locate these controls.
However, when it comes to creating Timer controls for each of these TabPages, there is no .Name property or any other way in which I can reference these controls short of having the variable name be an actual variable (which I don't know if that can be done in C# or not). I can't really use 1 timer because I want them to be able to run simultaneously.
So, I'm wondering what the best way would be to go about gaining access to these multiple Timers if I were to create them dynamically. I do know that I could be going about this all wrong, so if there's a better algorithmic approach than dynamically creating controls for each TabPage feel free to tell me.
Thanks a lot!