1,105,556 Community Members

How do I program a progress bar?

Member Avatar
W1ND0W5
Junior Poster
123 posts since May 2010
Reputation Points: 10 [?]
Q&As Helped to Solve: 9 [?]
Skill Endorsements: 0 [?]
 
0
 

Hello Daniweb, it's me (again).
I am making a web browser app and would like to have a loading bar. I'm using the default ProgressBar control but I don't know how to program it! Help!
Thanks for your help,
-Toby
--------------------------------------------------------------------------------------
If you put in your two pence worth, then someone, somewhere is making a penny.

Member Avatar
W1ND0W5
Junior Poster
123 posts since May 2010
Reputation Points: 10 [?]
Q&As Helped to Solve: 9 [?]
Skill Endorsements: 0 [?]
 
0
 

And plus, we have coded our Quit button to play a sound then exit. It exits then plays no sound at all. This is our code:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim exitSound As String = "C:\stop.wav"
        If IO.File.Exists(exitSound) Then
            My.Computer.Audio.Play(exitSound)
        Else
            MsgBox("Application error. C:\stop.wav not found or corrupted. The app or file needs to be reinstalled.", MsgBoxStyle.Critical)
        End If
        Me.Close()
    End Sub
End Class
Member Avatar
codeorder
Postaholic
2,027 posts since Aug 2010
Reputation Points: 197 [?]
Q&As Helped to Solve: 390 [?]
Skill Endorsements: 10 [?]
 
0
 

Use the .ProgressChanged Event of the Webbrowser you are using.

Private Sub WebBrowser1_ProgressChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles WebBrowser1.ProgressChanged
        ProgressBar1.Maximum = e.MaximumProgress
        ProgressBar1.Value = e.CurrentProgress
    End Sub
Member Avatar
codedude
Newbie Poster
12 posts since Jul 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

try this...

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
         Dim exitSound As String = "C:\stop.wav"         
         Dim fSound as New FileInfo(exitSound)
         If IO.File.Exists(fSound) Then            
            My.Computer.Audio.Play(exitSound, AudioPlayMode.Background)
         Else
            MsgBox("Application error. C:\stop.wav not found or corrupted. The app or file needs to be reinstalled.", MsgBoxStyle.Critical)
         End If
         Me.Close()
      End Sub
      End Class
Member Avatar
W1ND0W5
Junior Poster
123 posts since May 2010
Reputation Points: 10 [?]
Q&As Helped to Solve: 9 [?]
Skill Endorsements: 0 [?]
 
0
 

@codeorder: Thanks!
@codedude: Sorry, not working.

Member Avatar
codedude
Newbie Poster
12 posts since Jul 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

the same coding which you provided is working for me.I mean it plays sound.did you check its order of execution with breakpoint.?


And plus, we have coded our Quit button to play a sound then exit. It exits then plays no sound at all. This is our code:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim exitSound As String = "C:\stop.wav"
        If IO.File.Exists(exitSound) Then
            My.Computer.Audio.Play(exitSound)
        Else
            MsgBox("Application error. C:\stop.wav not found or corrupted. The app or file needs to be reinstalled.", MsgBoxStyle.Critical)
        End If
        Me.Close()
    End Sub
End Class
Member Avatar
W1ND0W5
Junior Poster
123 posts since May 2010
Reputation Points: 10 [?]
Q&As Helped to Solve: 9 [?]
Skill Endorsements: 0 [?]
 
0
 

Breakpoint? What's Breakpoint? And how do I access it from VB2010?

Member Avatar
brijeshsonagara
Newbie Poster
1 post since Sep 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

how to implement keyascii with timer like as typing tutor..

Question Answered as of 3 Years Ago by codedude, codeorder and brijeshsonagara
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: