Question How to create timers dynamically and give them different names?

misteralex

Member
Joined
Mar 16, 2016
Messages
8
Programming Experience
Beginner
Hey guys,
I currently want to create different timers in a loop and give them different names.


I want to have a loop like this


VB.NET:
For i = 0 to txtNumberOfLoops.Text


Dim timerrr & i as New Timer


Next


So bascially, I want to create for example timerrr1, timerrr2, timerrr3 in a loop.


How can I reference the timers after creation?
 
You can put them in a collection/array and access by index. If you need to access by name use a Dictionary with string keys.
 
Back
Top