VB.NET: Progress bar problem with a timer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jirachi
    New Member
    • Dec 2007
    • 2

    VB.NET: Progress bar problem with a timer

    I have a splash screen set up with a 5 second timer, no problems there. When I try to add a Progress Bar it does not function. This is for a school project but usually I don't have problems. This is my first time using a progress bar but maybe this requires some special touch I am currently unaware of.
    Last edited by Killer42; Dec 18 '07, 07:45 AM.
  • SammyB
    Recognized Expert Contributor
    • Mar 2007
    • 807

    #2
    What VB are you using? VB.NET, VB6, or VBA?

    You will need to set your timer interval to an increment of the 5 seconds, say every half second and update the progress bar ten times and then exit the splash screen. HTH --Sam

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      You need to increase the value of progressbar on timer event. Once it reaches its maxvalue, close the splash screen and go to the desired location in application.
      Last edited by Killer42; Dec 18 '07, 07:46 AM.

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        The basic problem most people run into is not realising that the progress bar doesn't actually do anything for itself. It's just a fancy way of displaying the information you pass to it.

        You start out by setting the upper and lower limits. Then periodically you pass it a value (within these limits) to say how far you have progressed. It merely displays that value in a graphical format.

        So, it's up to you to track your progress, and periodically pass a value to the ProgressBar control. Clear?

        Comment

        • Jirachi
          New Member
          • Dec 2007
          • 2

          #5
          [code=VBNET]While (Me.uiProgressB ar.Value < Me.uiProgressBa r.Maximum)
          Me.uiProgressBa r.Value = Me.uiProgressBa r.Value + 1
          End While
          Me.Close()[/code]

          This is what I have inside the Timer function. I must be missing something here. I'm assuming the Timer function doesn't perform the commands inside it until the timer has completed its intended duration. How can I force it to check or something similar? Or maybe I'm using it entirely wrong, I'll keep looking, though.

          I'm using VB.NET by the way.

          EDIT: I got it working now :)
          Last edited by Killer42; Dec 18 '07, 09:43 PM.

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Glad to see you got it worked out. :)

            I hope you realised what was wrong with the While loop.

            Comment

            Working...