Results 1 to 2 of 2

Thread: Web Broswer Help

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Question Web Broswer Help

    Hi Im a Noob at this .. this is my first creation, i want a step by step guide like if anyone can manage that thanks .
    i want to create drop down menus where the url goes like IE8 , also wanna create Tabs For Web Browser . I want To Also Make Favorites and history and thats it for now like IE8 Please Can Someone Help Me ill paste my code below

    Code:
    Public Class Form1
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            WebBrowser1.Navigate(TextBox1.Text)
            WebBrowser1.WebBrowserShortcutsEnabled = True
    
    
        End Sub
        Private Sub Navigate(ByVal address As String)
    
            If String.IsNullOrEmpty(address) Then Return
            If address.Equals("about:blank") Then Return
            If Not address.StartsWith("http://") And _
                Not address.StartsWith("https://") Then
                address = "http://" & address
            End If
    
            Try
                WebBrowser1.Navigate(New Uri(address))
            Catch ex As System.UriFormatException
                Return
            End Try
    
        End Sub
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            WebBrowser1.GoBack()
        End Sub
        Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
            WebBrowser1.GoForward()
        End Sub
        Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
            WebBrowser1.Refresh()
            ProgressBar1.Increment(1)
            If Timer1.Enabled = True Then
                ProgressBar1.Value = 0
            End If
            If Timer2.Enabled = True Then
                ProgressBar1.Value = 100
            End If
          
        End Sub
    
        Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
            WebBrowser1.Stop()
            If Timer1.Enabled = True Then
                ProgressBar1.Value = 0
            End If
        End Sub
        Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
            WebBrowser1.GoHome()
            WebBrowser1.Navigate("sharewarez.sqweebs.com")
    
            ProgressBar1.Increment(1)
            If Timer2.Enabled = True Then
                ProgressBar1.Value = 100
            End If
        End Sub
    
        Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
    
        End Sub
        Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
            If e.KeyCode = Keys.Enter Then Button1.PerformClick()
    
        End Sub
    
        Private Sub ProgressBar1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
            ProgressBar1.Increment(1)
            If Timer1.Enabled = True Then
                ProgressBar1.Value = 0
            End If
            If Timer2.Enabled = True Then
                ProgressBar1.Value = 100
            End If
           
        End Sub
    
        Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
    
        End Sub
    
        Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
            ProgressBar1.Increment(1)
            If Timer1.Enabled = True Then
                ProgressBar1.Value = 0
            End If
            If Timer2.Enabled = True Then
                ProgressBar1.Value = 100
            End If
            If Timer1.Enabled = True Then
                ProgressBar1.Value = 0
            End If
        End Sub
    
        Private Sub WebBrowser1_Navigated(ByVal sender As Object, _
        ByVal e As WebBrowserNavigatedEventArgs) _
        Handles WebBrowser1.Navigated
    
            TextBox1.Text = WebBrowser1.Url.ToString()
    
        End Sub
    End Class

  2. #2
    Frenzied Member stateofidleness's Avatar
    Join Date
    Jan 2009
    Posts
    1,780

    Re: Web Broswer Help

    well that is a lot of stuff, and to be honest most of it is very basic stuff. If you are new to programming in general, it is best to start with the basics (a good teacher or book is priceless).

    Dropdown box of URLs: ComboBox control, start there
    Tabbed Browser: TabControl, start there (search this forum for tabbed browser)
    Favorites and History: brainstorm on how you want to "save" them (file, folder, etc)

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