problem in showing progress while downloading

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phpfreak2007
    New Member
    • Sep 2007
    • 31

    problem in showing progress while downloading

    Hi all

    I tried to display an gif image while my file is downloading from server..But as downloading started, animation in gif is stopped...I tried to use thread also but then too its not working..

    Please help me to solve this.
  • alag20
    New Member
    • Apr 2007
    • 84

    #2
    I had similar issue some time ago. I made a new window with picture box and a timer which was triggered every 1/4 sec. This would refresh the form with a new image [so i was animating it]. I started this form in a new thread - worked like a charm!

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      Shouldn't the client browser have it's own download progress thinger?

      Comment

      • phpfreak2007
        New Member
        • Sep 2007
        • 31

        #4
        Originally posted by alag20
        I had similar issue some time ago. I made a new window with picture box and a timer which was triggered every 1/4 sec. This would refresh the form with a new image [so i was animating it]. I started this form in a new thread - worked like a charm!


        hi alag20

        Thanks for reply.. I tried your way also.. but now problem is its showing new form but not animation I am sending you code..please let me know If I am doing any mistake..

        Code:
        // initialization
        
          flag=true;
          Thread thrd = new Thread(new ThreadStart(animation));
          thrd.Start();
          //coding for download 
          flag=false;
        
        //animation method
        public void animation
        {
                  while (flag)
                    {
                       // new widows form with picturebox
                        frm.Show();
                    }
        }
        
        
        
        //code for timer in new window with picture box
        
        
        private void timer1_Tick(object sender, EventArgs e)
         {
                    if (i == imageList1.Images.Count)
                    {
                        i = 0;
                    }
                    pictureBox1.Image = imageList1.Images[i];
                     i++;
        }

        Comment

        Working...