Results 1 to 7 of 7

Thread: [2008] Progress Bar?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2008
    Posts
    12

    Unhappy [2008] Progress Bar?

    I am trying to code a Web Browser so that when you try to surf the web, a Progress Bar starts up. This is what I tried,

    Code:
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim Bar
            WebBrowser1.Navigate(TextBox1.Text)
            ProgressBar1.Maximum = 100
            ProgressBar1.Step = 1
            Bar = ProgressBar1.Value
    
            For x = 0 To 100
                ProgressBar1.PerformStep()
            Next
            If Bar = 100 Then
                Bar.Value = 0
            End If
        End Sub
    But it doesn't work. Any suggestions?

  2. #2
    Hyperactive Member
    Join Date
    Jun 2008
    Location
    Nowhere
    Posts
    427

    Re: [2008] Progress Bar?

    Try:
    vb Code:
    1. Private Sub Browser_ProgressChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs)
    2.                 Me.ToolStripProgressBar1.Maximum = CInt(e.MaximumProgress)
    3.                 Me.ToolStripProgressBar1.Value = CInt(e.CurrentProgress)
    4.     End Sub
    "Programming is like sex. One mistake and you have to support it for the rest of your life." ~Michael Sinz


    Code Snippets/Usefull Links:
    WinRAR DLL|Vista Style Form|Krypton Component Library|Windows Form Aero|Parsing XML files|Calculate File's CRC 32|Download a list of files.

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2008] Progress Bar?

    You might like to follow the Tabbed Web Browser link in my signature for some help and ideas.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2008
    Posts
    12

    Re: [2008] Progress Bar?

    Those didn't really help. Thank you for trying though, I really appreciate it.

  5. #5
    Frenzied Member
    Join Date
    Jan 2008
    Posts
    1,754

    Re: [2008] Progress Bar?

    Which didnt help? What yougbucks said or what jmcilhinney said?

    Since i am currently using the code that young bucks supplied...

  6. #6

    Thread Starter
    New Member
    Join Date
    Aug 2008
    Posts
    12

    Re: [2008] Progress Bar?

    Fixed it. I just added this to my code.

    Code:
        Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
            ToolStripProgressBar1.Value = 0
            Me.Text = WebBrowser1.DocumentTitle
    
    
        End Sub

  7. #7
    Frenzied Member
    Join Date
    Jan 2008
    Posts
    1,754

    Re: [2008] Progress Bar?

    I dont think you need to set the value back to 0. When i used the code that youngbucks supplied it will set the progressbar back to 0 after the page is complete.

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