I am working on a small program and, everything works fine. Instead of having a hard coded timer though, I’d like to change the timers interval from the form from a listbox or a numericupdownbox, combobox or something along those lines.
So instead of it being a hard coded 3000MS like it is I wanted to be able to change it on the form from a small menu with 1000-10000 milliseconds.
The thing is, I am not sure how to tell the timer to use an interval specified in a optional box.
Is it possible?
Thanks.
If you’re going to use a control that allows for a non-numeric input such as a
TextBoxensure you validate that the input is in fact a number. Better to trap errors in the first place than deal with exceptions later.You can omit the checking above if you’re using a
NumericUpDowncontrol as it only allows a numeric value.