-
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?
-
Re: Progress Bar
hmm, maybe set your style property of the progress bar to marquee?