Threaded Splashscreen with Timer

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

    Threaded Splashscreen with Timer

    I have a splashscreen running on a thread from Sub Main and it works OK. It
    displays information in a statusbar about queries. I also have a time on the
    splashscreen, but the tick event never gets fired. In the Load Event if the
    splashscreen I call the timer's Start() event. HOw do I get the tick event
    to fire?
  • Cor Ligthert

    #2
    Re: Threaded Splashscreen with Timer

    Bob,

    There are 3 timers, which one are you using?

    Cor
    "Bob"[color=blue]
    >I have a splashscreen running on a thread from Sub Main and it works OK.
    >It
    > displays information in a statusbar about queries. I also have a time on
    > the
    > splashscreen, but the tick event never gets fired. In the Load Event if
    > the
    > splashscreen I call the timer's Start() event. HOw do I get the tick
    > event
    > to fire?[/color]


    Comment

    • Cor Ligthert

      #3
      Re: Threaded Splashscreen with Timer

      Bob,

      There are 3 timers, which one are you using?

      Cor
      "Bob"[color=blue]
      >I have a splashscreen running on a thread from Sub Main and it works OK.
      >It
      > displays information in a statusbar about queries. I also have a time on
      > the
      > splashscreen, but the tick event never gets fired. In the Load Event if
      > the
      > splashscreen I call the timer's Start() event. HOw do I get the tick
      > event
      > to fire?[/color]


      Comment

      • Imran Koradia

        #4
        Re: Threaded Splashscreen with Timer

        As Cor mentioned, there are 3 timers available. Since you are looking for
        the Tick event, I assume you are using the System.Windows. Forms.Timer timer.
        This timer runs on the same thread as the main application thread. As a
        result, while you are doing some processing, the main thread is busy doing
        that work and is not free to fire the Tick event of the timer. I would
        suggest using the System.Timers.T imer timer and watch for the Elapsed event
        (similar to the tick event). This timer runs on a different thread than the
        main application and hence the thread will be able to fire the Elapsed event
        when the timer's interval is completed.

        hope that helps..
        Imran.

        "Bob" <Bob@discussion s.microsoft.com > wrote in message
        news:36193E48-709E-4198-848E-FF63320E28B0@mi crosoft.com...[color=blue]
        > I have a splashscreen running on a thread from Sub Main and it works OK.[/color]
        It[color=blue]
        > displays information in a statusbar about queries. I also have a time on[/color]
        the[color=blue]
        > splashscreen, but the tick event never gets fired. In the Load Event if[/color]
        the[color=blue]
        > splashscreen I call the timer's Start() event. HOw do I get the tick[/color]
        event[color=blue]
        > to fire?[/color]


        Comment

        • Imran Koradia

          #5
          Re: Threaded Splashscreen with Timer

          As Cor mentioned, there are 3 timers available. Since you are looking for
          the Tick event, I assume you are using the System.Windows. Forms.Timer timer.
          This timer runs on the same thread as the main application thread. As a
          result, while you are doing some processing, the main thread is busy doing
          that work and is not free to fire the Tick event of the timer. I would
          suggest using the System.Timers.T imer timer and watch for the Elapsed event
          (similar to the tick event). This timer runs on a different thread than the
          main application and hence the thread will be able to fire the Elapsed event
          when the timer's interval is completed.

          hope that helps..
          Imran.

          "Bob" <Bob@discussion s.microsoft.com > wrote in message
          news:36193E48-709E-4198-848E-FF63320E28B0@mi crosoft.com...[color=blue]
          > I have a splashscreen running on a thread from Sub Main and it works OK.[/color]
          It[color=blue]
          > displays information in a statusbar about queries. I also have a time on[/color]
          the[color=blue]
          > splashscreen, but the tick event never gets fired. In the Load Event if[/color]
          the[color=blue]
          > splashscreen I call the timer's Start() event. HOw do I get the tick[/color]
          event[color=blue]
          > to fire?[/color]


          Comment

          • Bob

            #6
            Re: Threaded Splashscreen with Timer

            I added a timer control to the form.

            "Cor Ligthert" wrote:
            [color=blue]
            > Bob,
            >
            > There are 3 timers, which one are you using?
            >
            > Cor
            > "Bob"[color=green]
            > >I have a splashscreen running on a thread from Sub Main and it works OK.
            > >It
            > > displays information in a statusbar about queries. I also have a time on
            > > the
            > > splashscreen, but the tick event never gets fired. In the Load Event if
            > > the
            > > splashscreen I call the timer's Start() event. HOw do I get the tick
            > > event
            > > to fire?[/color]
            >
            >
            >[/color]

            Comment

            • Bob

              #7
              Re: Threaded Splashscreen with Timer

              I added a timer control to the form.

              "Cor Ligthert" wrote:
              [color=blue]
              > Bob,
              >
              > There are 3 timers, which one are you using?
              >
              > Cor
              > "Bob"[color=green]
              > >I have a splashscreen running on a thread from Sub Main and it works OK.
              > >It
              > > displays information in a statusbar about queries. I also have a time on
              > > the
              > > splashscreen, but the tick event never gets fired. In the Load Event if
              > > the
              > > splashscreen I call the timer's Start() event. HOw do I get the tick
              > > event
              > > to fire?[/color]
              >
              >
              >[/color]

              Comment

              • Cor Ligthert

                #8
                Re: Threaded Splashscreen with Timer

                Bob,

                You saw the answer at the message from Imran, I have nothing to add to that.

                Cor

                "Bob"
                [color=blue]
                >I added a timer control to the form.
                >
                > "Cor Ligthert" wrote:
                >[color=green]
                >> Bob,
                >>
                >> There are 3 timers, which one are you using?
                >>
                >> Cor
                >> "Bob"[color=darkred]
                >> >I have a splashscreen running on a thread from Sub Main and it works OK.
                >> >It
                >> > displays information in a statusbar about queries. I also have a time
                >> > on
                >> > the
                >> > splashscreen, but the tick event never gets fired. In the Load Event
                >> > if
                >> > the
                >> > splashscreen I call the timer's Start() event. HOw do I get the tick
                >> > event
                >> > to fire?[/color]
                >>
                >>
                >>[/color][/color]


                Comment

                • Cor Ligthert

                  #9
                  Re: Threaded Splashscreen with Timer

                  Bob,

                  You saw the answer at the message from Imran, I have nothing to add to that.

                  Cor

                  "Bob"
                  [color=blue]
                  >I added a timer control to the form.
                  >
                  > "Cor Ligthert" wrote:
                  >[color=green]
                  >> Bob,
                  >>
                  >> There are 3 timers, which one are you using?
                  >>
                  >> Cor
                  >> "Bob"[color=darkred]
                  >> >I have a splashscreen running on a thread from Sub Main and it works OK.
                  >> >It
                  >> > displays information in a statusbar about queries. I also have a time
                  >> > on
                  >> > the
                  >> > splashscreen, but the tick event never gets fired. In the Load Event
                  >> > if
                  >> > the
                  >> > splashscreen I call the timer's Start() event. HOw do I get the tick
                  >> > event
                  >> > to fire?[/color]
                  >>
                  >>
                  >>[/color][/color]


                  Comment

                  • Arne Janning

                    #10
                    Re: Threaded Splashscreen with Timer

                    Hi Bob,
                    [color=blue]
                    > "Bob" <Bob@discussion s.microsoft.com > schrieb
                    >I have a splashscreen running on a thread from Sub Main and it works OK.
                    >It
                    > displays information in a statusbar about queries. I also have a time on
                    > the
                    > splashscreen, but the tick event never gets fired. In the Load Event if
                    > the
                    > splashscreen I call the timer's Start() event. HOw do I get the tick
                    > event
                    > to fire?[/color]

                    Perhaps one of the examples here:


                    will help you.

                    Cheers

                    Arne Janning


                    Comment

                    • Arne Janning

                      #11
                      Re: Threaded Splashscreen with Timer

                      Hi Bob,
                      [color=blue]
                      > "Bob" <Bob@discussion s.microsoft.com > schrieb
                      >I have a splashscreen running on a thread from Sub Main and it works OK.
                      >It
                      > displays information in a statusbar about queries. I also have a time on
                      > the
                      > splashscreen, but the tick event never gets fired. In the Load Event if
                      > the
                      > splashscreen I call the timer's Start() event. HOw do I get the tick
                      > event
                      > to fire?[/color]

                      Perhaps one of the examples here:


                      will help you.

                      Cheers

                      Arne Janning


                      Comment

                      Working...