locked
Visul basic setting timer interval? RRS feed

  • Question


  • i have this code:
    IntervalTextBbox.Text = Timer1.Interval

    instead of it setting the timer interval that i put in the text box it puts the interval of the timer in the text box. How to i fix this or how else would i do it?

    • Edited by Riley19280 Thursday, June 13, 2013 2:16 PM
    Thursday, June 13, 2013 2:15 PM

Answers

  •     If Not Integer.TryParse(TextBbox.Text, Timer1.Interval) Then MessageBox.Show("Invalid text")

    • Proposed as answer by Barry Wang Friday, June 14, 2013 9:57 AM
    • Marked as answer by Barry Wang Friday, June 21, 2013 10:05 AM
    Thursday, June 13, 2013 5:26 PM

All replies

  • Convert the text to an integer and set Timer1.Interval to the result.
    Thursday, June 13, 2013 2:43 PM
  • how would i convert it to an integer?

    Thursday, June 13, 2013 5:19 PM
  •     If Not Integer.TryParse(TextBbox.Text, Timer1.Interval) Then MessageBox.Show("Invalid text")

    • Proposed as answer by Barry Wang Friday, June 14, 2013 9:57 AM
    • Marked as answer by Barry Wang Friday, June 21, 2013 10:05 AM
    Thursday, June 13, 2013 5:26 PM