Results 1 to 2 of 2

Thread: Progress Bar

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2009
    Posts
    313

    Progress Bar

    I've made a small app that checks my IP adress like this:

    Code:
    Dim req As HttpWebRequest = WebRequest.Create("http://whatismyip.com/automation/n09230945.asp")
            Dim response As HttpWebResponse = req.GetResponse()
            Dim Stream As Stream = res.GetResponseStream()
            Dim sr As StreamReader = New StreamReader(Stream)
    MsgBox((sr.ReadToEnd()))
    It gives me what I need,but it takes about 10-15 sec to display the msgbox,so I decided to use a ProgressBar.But thats where my problems start.
    I set ProgressBar1.Minimum to 0,ProgressBar1.Value to 0,and ProgressBar1.Step to 1.

    Since I do not know the Maximum value,I decided to use:
    Code:
    Dim stoperica As New System.Diagnostics.Stopwatch
    That way I can get the elapsed time and convert it to integer value.

    Code:
    stoperica.Start()
    
        proteklo_vrijeme = stoperica.Elapsed.Seconds.ToString
        konverzija = Convert.ToInt32(proteklo_vrijeme)
         stoperica.Stop()
    But the problem is I cannot use elapsed time,since I know it's value only after the stopwatch has stopped.
    What can I do to make this work?

  2. #2
    Fanatic Member
    Join Date
    Aug 2009
    Posts
    540

    Re: Progress Bar

    hmm, maybe set your style property of the progress bar to marquee?
    Where I'm from we only have one bit of advice for new comers: "If you hear banjos, turn and run".


    VS 2008 .NetFW 2.0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width