Results 1 to 3 of 3

Thread: Timers

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2015
    Posts
    73

    Timers

    Is there a way to loop timers? Say if I want something to show for 3 seconds, then disappear for 3 seconds, then show again and do this over and over? I'm just playing around trying to learn some new things, wondering if there would be a way to use a loop to make a timer do this.

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

    Re: Timers

    A Timer already behaves like that by default. A Windows Forms Timer raises its Tick event repeatedly while its enabled, with how often its raised being controlled by the Interval property. If you want a Tick event every three seconds then you set the Interval to 3000. What you want to do is reverse the visibility of something each Tick, which would be done like this:
    Code:
    myControl.Visible = Not myControl.Visible
    If it's currently True then it becomes False and vice versa.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2015
    Posts
    73

    Re: Timers

    Ah I see. I had thought that was all I needed to do but I was using the wrong property. It was on a picture box and I was disabling and enabling it instead of using the visible property. Thank you!

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