Eräällä sivulla, jossa opastettiin miten tehdään oma selain vb .netillä, kerrottiin myös, miten lisätään progressbar, josta näkee miten paljon sivusta on ladattu. No en kumminkaan usko että se toimii.Kysymys on siis, miten sellaisen saisi toteutettua. Alla on alkuperäinen versio joka ei tee mitään, ja minun muokkaama, joka toimii kun kutsun sitä.
** Alkuperäinen
'This to make the progress bar work and to show a status message, and an image.
Private Sub WebBrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
On Error Resume Next
If Progress = -1 Then ProgressBar1.Value = 100 'the name of the progress bar is "ProgressBar1".
Label1.Caption = "Done"
ProgressBar1.Visible = False 'This makes the progress bar disappear after the page is loaded.
Image1.Visible = True
If Progress > 0 And ProgressMax > 0 Then
ProgressBar1.Visible = True
Image1.Visible = False
ProgressBar1.Value = Progress * 100 / ProgressMax
Label1.Caption = Int(Progress * 100 / ProgressMax) & "%"
End If
Exit Sub
End Sub
** Muokattu
Sub muuttuja(ByVal Progress As Long, ByVal ProgressMax As Long)
On Error Resume Next
If Progress = -1 Then ProgressBar1.Value = 100 'the name of the progress bar is "ProgressBar1".
statussi.Text = "Done"
'ProgressBar1.Visible = False 'This makes the progress bar disappear after the page is loaded.
image1.Visible = True
If Progress > 0 And ProgressMax > 0 Then
'ProgressBar1.Visible = True
image1.Visible = False
ProgressBar1.Value = Progress * 100 / ProgressMax
statussi.Text = Int(Progress * 100 / ProgressMax) & "%"
End If
Exit Sub
End SubAihe on jo aika vanha, joten et voi enää vastata siihen.