VB Web Browser Control
The Web Browser control allows you to build a web browser.
There are several functions and properties you can access which gives you access to creating a beginners basic to a more advanced web browser.
Below are a list of functions and properties with short descriptions to what each function/property does.
| Web Browser Functions | |||||||||
| Navigate Go | WebBrowser1.Navigate("http://www.google.ca")Browser will navigate to specified URL at runtime |
||||||||
| Navigate Back | WebBrowser1.GoBack()Sends Web Browser to previous visited page. This is used to navigate to previous web pages. |
||||||||
| Navigate Forward | WebBrowser1.GoForward()Works the same as Back but sends web browser to the Next page if the Previous page is displayed |
||||||||
| Navigate Home | WebBrowser1.GoHome()Sends the web page to the default URL (specified under Navigate Go) |
||||||||
| Browser Refresh | WebBrowser1.Refresh()Refreshes the web browser |
||||||||
| Browser Stop | WebBrowser1.Stop()Stops the progress of the web browser while loading |
||||||||
| Web Browser Properties | |||||||||
| Browser Status | WebBrowser1.StatusTextDisplays the current status of the web page loading |
||||||||
| Default URL | WebBrowser1.urlSets the default web browser URL which is displayed at runtime. |
||||||||
| Status Check | WebBrowser1.IsBusyThis is a Boolean (True Or False) Checks to see if the web browser is busy loading content from the web page. |
||||||||
| Ready State | WebBrowser1.ReadyStateGets the current state of the web browser (Should be used on a timer for accurate results) Results are fetched as a Numerical value (There are 4 values/steps a browser goes through)
|
||||||||
Ready State example of use:
Declare 4 variables, 1 for each state.
Dim Complete As String = WebBrowser1.ReadyState = WebBrowserReadyState.Complete
Dim Interactive As String = WebBrowser1.ReadyState =
WebBrowserReadyState.Interactive
Dim Loaded As String = WebBrowser1.ReadyState =
WebBrowserReadyState.Loaded
Dim Loading As String = WebBrowser1.ReadyState =
WebBrowserReadyState.Loading
Use your declarations in If statements
If Interactive Then Me.Text = "Not yet loaded"
ElseIf Complete Then Me.Text = "Ready"
End If
Leave a Reply
You must be logged in to post a comment.