Im new to C#, i went from VB to C#, so this is completly new for me.
I want the timer1.interval to be the value of a textbox.
Something like this i guess
But it dosent work..Code:timer1.Interval = (textBox2.value);
Can anybody help me? =)
Printable View
Im new to C#, i went from VB to C#, so this is completly new for me.
I want the timer1.interval to be the value of a textbox.
Something like this i guess
But it dosent work..Code:timer1.Interval = (textBox2.value);
Can anybody help me? =)
To get the value of a textbox it is no different from VB to C#. textBox2.Text
And the Timer.Interval property receives an Integer value so you should also cast it:
timer1.Interval = (int)textBox2.Text;
It dosent work?
Code:timer1.Interval = Convert.ToInt32(textBox2.Text);
Thank you!
Remember when using Timer Intervals:
500 = half a second
1000 = 1 second
2000 = 2 seconds
etc...
You should be using Parse, or better yet TryParse for conversion of strings to integers.