progressbar in popup

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

    #1

    progressbar in popup

    Hi,
    I have to process a large data loading in my form. In order to give a
    feedback on the loading status, I'd like to display a progressbar in a
    popup, in the middle of the screen. How can I do that, as the
    progressbar is not in the same form as my data structures?

    Thx

  • Cor Ligthert [MVP]

    #2
    Re: progressbar in popup

    Sam,

    There are hundreds ways that data is stored. Than there are probably
    hundered ways that data is processes. What answer do you want from us a link
    to the progressbar on MSDN?

    Cor


    Comment

    • Sam

      #3
      Re: progressbar in popup

      Hi Cor,
      That's true, I haven't been very clear.
      I'm actually building a tree and I don't know how much time it's gonna
      take or even how many items will be added, as the data come from many
      different stored procedures. Therefore I'm thinking about showing a
      progressbar during the time of the tree construction. Basically I would
      show the form that contains the bar before calling my BuildTree
      function and I would close it as soon as the function finished. I would
      like the bar to actually move from left to right and then from right to
      left, kindof a fancy effect.
      How can I achieve that?

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: progressbar in popup

        Sam,

        What is the in memory data the stored procedures point to. When it is a
        dataset or datatables, how many Fill you have to handle?

        If it is a datareader, than you can take two progressbars above each other.

        In my idea is the simplest approach counting the stored procedures and take
        those as steps. The progressbar documentation on MSDN does that.

        If you want a procedure that I will not advice however because it is often
        asked and therefore this sample (however you can see in that how to use a
        progressbar).



        I hope this helps,

        Cor


        Cor


        Comment

        • Herfried K. Wagner [MVP]

          #5
          Re: progressbar in popup

          "Sam" <samuel.berthel ot@voila.fr> schrieb:[color=blue]
          > I have to process a large data loading in my form. In order to give a
          > feedback on the loading status, I'd like to display a progressbar in a
          > popup, in the middle of the screen. How can I do that, as the
          > progressbar is not in the same form as my data structures?[/color]

          Check out the last sample on this page:

          Multithreading in Windows Forms applications
          <URL:http://dotnet.mvps.org/dotnet/faqs/?id=multithread ing&lang=en>

          --
          M S Herfried K. Wagner
          M V P <URL:http://dotnet.mvps.org/>
          V B <URL:http://classicvb.org/petition/>

          Comment

          • Sam

            #6
            Re: progressbar in popup

            thanks, that's a cool and useful link!

            Comment

            • Sam

              #7
              Re: progressbar in popup

              May I ask a question regarding the code on the link you gave me? In the
              following block of code:

              for( int i = 0 ; i < 100 ; ++i )
              {
              callback.SetTex t( String.Format( "Performing op: {0}", i )
              );
              callback.StepTo ( i );
              if( callback.IsAbor ting )
              {
              return;
              }
              // Do a block of work
              if( callback.IsAbor ting )
              {
              return;
              }
              }

              When the author wrote //Do a block of work, I don't understand how you
              can do different operations at each loop. Because obviously since I'm
              building a tree, at each iteration of the for loop, I would like to
              call a different method that handles building a sub-part of my tree.
              (it's the way it currentely works). So how can I do that in this loop?

              Thx

              Comment

              Working...