Results 1 to 5 of 5

Thread: [RESOLVED] C# auto timer

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    524

    Resolved [RESOLVED] C# auto timer

    How to make timer to change his Interval from Combobox.items to read what minute is selected?

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    524

    Re: C# auto timer

    i try with button click to start it
    this.timer1.Interval = (int)numericUpDown1.Value;
    timer1.Start();
    but it doesnt read info from numericUpDown what i type in value

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: C# auto timer

    The Timer doesn't change its Interval. YOU change it's Interval. If you want to set the Interval from a ComboBox selection then get the selection from the ComboBox and assign it to the Interval of the Timer. It's just as obvious as it sounds. Just keep in mind that Timer.Interval is measured in milliseconds, so if you have a number of minutes then you must multiply by 60,000.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: C# auto timer

    Quote Originally Posted by diablo21 View Post
    i try with button click to start it
    this.timer1.Interval = (int)numericUpDown1.Value;
    timer1.Start();
    but it doesnt read info from numericUpDown what i type in value
    You're going to have to explain what you mean by that. The Timer isn't reading anything. Your code is getting the Value from the NumericUpDown. It's getting it alright. Have you looked at the value of the Interval property after that code? Is it what you expect? If not, what is it and what did you expect it to be? If it is then it is, so what's the actual problem?

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    524

    Re: C# auto timer

    nvm i managed to fix it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width