Timers

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Earl Partridge

    Timers

    I have 6 labels that I want to display, one at a time, in 15 second intervals. After all 6 have
    been displayed, I want to restart, displaying all 6 again, continuously.
    Experimenting with just 2 labels and 1 timer, I set the timer Interval accordingly, then I make
    Label1.visible False, and Label2.visible True, and this works fine, but I'm a bit confused as to
    how to continue with Labels 3 - 6, and how to restart at #1 again.
    Earl


  • Mike Williams

    #2
    Re: Timers

    "Earl Partridge" <earlpNG@pearne t.comwrote in message
    news:eBfb0WkpIH A.6096@TK2MSFTN GP06.phx.gbl...
    I have 6 labels that I want to display, one at a time, in
    15 second intervals. After all 6 have been displayed,
    I want to restart, displaying all 6 again, continuously.
    If you are using Visual Basic then you can create an array of Labels with
    indexes 0 to 5 (or 1 to 6 or whatever you are most comfortable with) and
    then in the Timer routine you can set up a Static variable as a counter and
    refer to each of the Labels in turn using its Index property, incrementing
    the counter each time the Timer routine fires. When you get to the last
    Label in the array then simply set your Static variable back to 0 (or 1 or
    whatever is the Index of the first Label in the array).

    Mike



    Comment

    • Tom Shelton

      #3
      Re: Timers

      On 2008-04-25, Earl Partridge <earlpNG@pearne t.comwrote:
      I'm afraid I'm out of my league, having done no VB programming for about the
      past
      12 years... never got into "collection s". I may have to try that array
      suggestion Mike
      Williams suggested.
      >
      As for Lloyd's suggestion for list(of label), would that coding go for the
      form.load or
      in the timer section? Would there be an example somewhere I could view?
      >
      Mikes solution is not going to work for you... Simply because there is
      no such thing as a control array in VB.NET. He is purposely suggesting
      a VB6 solution to a VB.NET problem.

      All I can tell you is that Collections are fundamental part of
      progamming in any language, so it's a good a time as any to learn them
      :)

      Queue(Of T) and List(Of T) are located in the System.Collecti ons.Generic
      namespace. Which is a good place to start in the documentation.. .

      --
      Tom Shelton

      Comment

      • Tom Shelton

        #4
        Re: Timers

        On Apr 24, 10:18 pm, "Cor Ligthert[MVP]" <notmyfirstn... @planet.nl>
        wrote:
        Tom and Loyd
        >
        I don't think that a whatever list or collection here has any advantage over
        a simple array of labels.
        >
        dim timerLabels(5) = {Label1, label2, label3, label4, label5, label6}
        older VB versions from this milenium than version 2008
        dim timerLabels(5) as label = {Label1, label2, label3, label4, label5,
        label6}
        >
        This is in my idea here the most effective, because it is just a fixed
        array.
        >
        (This also written because of the confusion by the OP about a control array,
        of course there can be arrays of controls, they don't however have that
        limited use as in VB versions from the previous milenium).
        >
        Cor
        >
        An array works as well. I was leaning towards a queue initially,
        simply because of the fact that it can self rotate - no need of the
        extra variable to track the index :)

        --
        Tom Shelton

        Comment

        • Mike Williams

          #5
          Re: Timers

          "Tom Shelton" <tom_shelton@YO UKNOWTHEDRILLco mcast.netwrote in message
          news:eW9ZiqmpIH A.4912@TK2MSFTN GP03.phx.gbl...
          Mikes solution is not going to work for you... Simply
          because there is no such thing as a control array in
          VB.NET. He is purposely suggesting a VB6 solution
          to a VB.NET problem.
          .. . . in exactly the same way that Bill McCarthy, who has been trolling the
          VB6 group for months, purposely suggests vb.net solutions to VB6 questions
          on the VB6 group. I've only just started doing it here. McCarthy has been
          doing it for months on the VB6 group. Perhaps he might like to sop doing it?

          Mike



          Comment

          • Bill McCarthy

            #6
            Re: Timers


            "Mike Williams" <mikea@whiskyan dCoke.comwrote in message
            news:upFlYEupIH A.4912@TK2MSFTN GP03.phx.gbl...
            "Tom Shelton" <tom_shelton@YO UKNOWTHEDRILLco mcast.netwrote in message
            news:eW9ZiqmpIH A.4912@TK2MSFTN GP03.phx.gbl...
            >
            >Mikes solution is not going to work for you... Simply
            >because there is no such thing as a control array in
            >VB.NET. He is purposely suggesting a VB6 solution
            >to a VB.NET problem.
            >
            . . . in exactly the same way that Bill McCarthy, who has been trolling
            the VB6 group for months, purposely suggests vb.net solutions to VB6
            questions on the VB6 group. I've only just started doing it here. McCarthy
            has been doing it for months on the VB6 group. Perhaps he might like to
            sop doing it?
            >
            Let it go Mike. Folks here have asked you to stop trolling, and folks in
            the Vb6 forum have also told you to stop trying to start flames by your
            constant attacks on folks.
            As fun as it is to humor you, over the last two weeks you've waged many
            personal attacks on me, first claiming I was someone else, then some other
            silly conspiracy rant, and most recently your dishonest attack on me because
            you say I didn't correct Cor. Your above claim that I provide .net answers
            to VB6 questions is in fact a lie, another figment of your imagination
            again. I have only provided dotnet answers to dotnet questions.
            Oh, and if you think you can bully or intimidate me, you're going to learn a
            lesson the hard way. I suggest you talk to folks who know me, as I can
            assure you I have been around the VB forums while you were still driving
            taxis for a living. The best advice I can give you now Mike, is listen to
            the advice everyone is giving you, and desist from any further attacks.

            HTH's.

            Comment

            • Bill McCarthy

              #7
              Re: Timers


              "Mike Williams" <mikea@whiskyan dCoke.comwrote in message
              news:eCWVbSupIH A.1768@TK2MSFTN GP03.phx.gbl...
              "rowe_newsgroup s" <rowe_email@yah oo.comwrote in message
              news:6d83cd05-a7fe-41bc-838b-18c883630877@a2 2g2000hsc.googl egroups.com...
              >
              >Sigh, Please tell me I'm not going to have to treat you
              >like I used to treat aaron kempf and follow you through
              >the threads and mark them as trolling attempts?
              >
              Yep. That's what it looks like you're going to have to do.
              Look Mike, everybody, even your wife has told you to stop.

              Comment

              • Mike Williams

                #8
                Re: Timers

                "Bill McCarthy" <Bill@N0SPAM.co mwrote in message
                news:usjYIwupIH A.4476@TK2MSFTN GP04.phx.gbl...
                Look Mike, everybody, even your wife has told you to stop.
                I'll stop when you do. You started this business. Stop trolling the VB6
                group.

                Mike




                Comment

                Working...