Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. how to run the progresbar.......??

how to run the progresbar.......??

Scheduled Pinned Locked Moved Visual Basic
questioncsstutorial
9 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    Xandip
    wrote on last edited by
    #1

    i hav some huge amount of data loading into a grid... so i want to show a progresbar which shows the % completed . how do i do it..??

    K C D D 4 Replies Last reply
    0
    • X Xandip

      i hav some huge amount of data loading into a grid... so i want to show a progresbar which shows the % completed . how do i do it..??

      K Offline
      K Offline
      kubben
      wrote on last edited by
      #2

      The progress bar you have to set the min and max value and call the increment method when you have made some progress. You can also set the value directly. So your problem is know how far along are you in loading your grid. I am guessing you probably don't know that. So the best you can probably do, is put a timer control which executes every second. When the timer method runs increment the progress bar and refresh the form with Application.DoEvents. So then you users will think some progress is being made. Ben

      X 1 Reply Last reply
      0
      • X Xandip

        i hav some huge amount of data loading into a grid... so i want to show a progresbar which shows the % completed . how do i do it..??

        C Offline
        C Offline
        Crook_EVB
        wrote on last edited by
        #3

        First figure out a way to calculate your 'amount of data loaded' into a percentage value. Then add a progressbar onto your form and use this code in your loading sequence: ProgressBar1.Value = percent_data_loaded That's it.

        1 Reply Last reply
        0
        • K kubben

          The progress bar you have to set the min and max value and call the increment method when you have made some progress. You can also set the value directly. So your problem is know how far along are you in loading your grid. I am guessing you probably don't know that. So the best you can probably do, is put a timer control which executes every second. When the timer method runs increment the progress bar and refresh the form with Application.DoEvents. So then you users will think some progress is being made. Ben

          X Offline
          X Offline
          Xandip
          wrote on last edited by
          #4

          Ben, where do i get this 'Application.DoEvents'...?? i'm using vb

          K 1 Reply Last reply
          0
          • X Xandip

            i hav some huge amount of data loading into a grid... so i want to show a progresbar which shows the % completed . how do i do it..??

            D Offline
            D Offline
            Dileep_Vickey
            wrote on last edited by
            #5

            poda poda

            P P 2 Replies Last reply
            0
            • X Xandip

              Ben, where do i get this 'Application.DoEvents'...?? i'm using vb

              K Offline
              K Offline
              kubben
              wrote on last edited by
              #6

              Sorry for some reason I thought you were using vb.net It is a .net thing. I am not sure what it is in vb 6 Ben

              1 Reply Last reply
              0
              • D Dileep_Vickey

                poda poda

                P Offline
                P Offline
                Paul Conrad
                wrote on last edited by
                #7

                Dileep_Vickey wrote:

                poda poda

                :confused:

                1 Reply Last reply
                0
                • X Xandip

                  i hav some huge amount of data loading into a grid... so i want to show a progresbar which shows the % completed . how do i do it..??

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  Xandip wrote:

                  i hav some huge amount of data loading into a grid...

                  Why? The user only has so much screen space...

                  Xandip wrote:

                  so i want to show a progresbar which shows the % completed

                  This depends on where your code is spending all of it's time waiting. It 's waiting for a database query to return, there's nothing you can do to make a ProgressBar work. You need to use something that actually returns data in chunks in order for a ProgressBar to work. You can fill a DataSet object yourself using a DataReader, like this example[^], but this method is slower and will take longer to build your DataSet. Another version of a ProgressBar doesn't really show progress. Instead, it just shows something is going on, kind of like the Windows XP installation "little green boxes" that march along during the install. They don't show actual progress, just something that's moving to show that the machine hasn't locked up. You can find an example of this here[^].

                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007

                  1 Reply Last reply
                  0
                  • D Dileep_Vickey

                    poda poda

                    P Offline
                    P Offline
                    P P Vilsad
                    wrote on last edited by
                    #9

                    are you a malayalee, why are you bullying people:mad:

                    Vilsad P P MCTS (Windows Applications) .Net 2.0

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups