By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,901 Members | 1,436 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,901 IT Pros & Developers. It's quick & easy.

C# App - Simultaneous, Multiple Timers; Accessing

P: 1
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!
Jan 1 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.