Reference for Visual Basic Developers
This section contains a reference guide for using the WebBrowser control with Microsoft Visual Basic. This reference covers all the supported properties, methods, and events associated with the WebBrowser and InternetExplorer objects.
Objects
InternetExplorerControls an instance of Windows Internet Explorer through automation.
WebBrowserAdds browsing capabilities to your applications. For the Microsoft .NET Framework version of this control, see WebBrowser Control (Windows Forms).
Properties
AddressBarSets or gets a value that indicates whether the address bar of the object is visible or hidden.
ApplicationGets the automation object for the application that is hosting the WebBrowser Control.
BusyGets a value that indicates whether the object is engaged in a navigation or downloading operation.
ContainerGets an object reference to a container.
DocumentGets the automation object of the active document, if any.
FullNameRetrieves the fully qualified path of the Internet Explorer executable.
FullScreenSets or gets a value that indicates whether Internet Explorer is in full-screen mode or normal window mode.
HeightSets or gets the height of the object.
HWNDGets the handle of the Internet Explorer main window.
LeftSets or gets the coordinate of the left edge of the object.
LocationNameRetrieves the path or title of the resource that is currently displayed.
LocationURLGets the URL of the resource that is currently displayed.
MenuBarSets or gets a value that indicates whether the Internet Explorer menu bar is visible.
NameRetrieves the frame name or application name of the object.
OfflineSets or gets a value that indicates whether the object is operating in offline mode.
ParentGets the parent of the object.
PathRetrieves the system folder of the Internet Explorer executable.
ReadyStateGets the ready state of the object.
RegisterAsBrowserSets or gets a value that indicates whether the object is registered as a top-level browser window.
RegisterAsDropTargetSets or gets a value that indicates whether the object is registered as a drop target for navigation.
ResizableSets or gets a value that indicates whether the object can be resized.
SilentSets or gets a value that indicates whether the object can display dialog boxes.
StatusBarSets or gets a value that indicates whether the status bar for the object is visible.
StatusTextSets or gets the text in the status bar for the object.
TheaterModeSets or gets whether the object is in theater mode.
ToolBarSets or gets whether toolbars for the object are visible.
TopSets or gets the coordinate of the top edge of the object.
TopLevelContainerGets a value that indicates whether the object is a top-level container.
TypeGets the user type name of the contained document object.
VisibleSets or gets a value that indicates whether the object is visible or hidden.
WidthSets or gets the width of the object.
Methods
ClientToWindowComputes the full size of the browser window when given the specified width and height of the content area.
ExecWBExecutes a command and returns the status of the command execution using the IOleCommandTarget interface.
GetPropertyGets the value associated with a user-defined property name.
GoBackNavigates backward one item in the history list.
GoForwardNavigates forward one item in the history list.
GoHomeNavigates to the current home or start page.
GoSearchNavigates to the current search page.
NavigateNavigates to a resource identified by a URL or to a file identified by a full path.
Navigate2Navigates the browser to a location that might not be expressed as a URL, such as a pointer to an item identifier list (PIDL) for an entity in the Windows Shell namespace.
PutPropertyAssociates a user-defined name/value pair with the object.
QueryStatusWBQueries the object for the status of commands using the IOleCommandTarget interface.
QuitCloses the object.
RefreshReloads the file that is currently displayed in the object.
Refresh2Reloads the file that is currently displayed with the specified refresh level.
ShowBrowserBarShows or hides a specified browser bar.
StopCancels a pending navigation or download, and stops dynamic page elements, such as background sounds and animations.
Events
BeforeNavigateFires before navigation occurs in the given object (on either a window or frameset element).
BeforeNavigate2Fires before navigation occurs in the given object (on either a window element or a frameset element).
ClientToHostWindowFires to request that the client window size is converted to the host window size.
CommandStateChangeFires when the enabled state of a command changes.
DocumentCompleteFires when a document is completely loaded and initialized.
DownloadBeginFires when a navigation operation begins.
DownloadCompleteFires when a navigation operation finishes, is halted, or fails.
FileDownloadFires to indicate that a file download is about to occur. If a file download dialog box can be displayed, this event fires prior to the appearance of the dialog box.
NavigateCompleteFires after a navigation to a link is completed on either a window element or a frameSet element.
NavigateComplete2Fires after a navigation to a link is completed on a window element or a frameSet element.
NavigateErrorFires when an error occurs during navigation.
NewProcessCreates a new process to handle the navigation.
NewWindowFires when a new window is to be created.
NewWindow2Fires when a new window is to be created.
NewWindow3Raised when a new window is to be created. Extends NewWindow2 with additional information about the new window.
OnFullScreenFires when the FullScreen property is changed.
OnMenuBarFires when the MenuBar property is changed.
OnQuitFires before the Internet Explorer application quits.
OnStatusBarFires when the StatusBar property is changed.
OnTheaterModeFires when the TheaterMode property is changed.
OnToolBarFires when the ToolBar property is changed.
OnVisibleFires when the Visible property of the object is changed.
PrintTemplateInstantiationFires when a print template is instantiated.
PrintTemplateTeardownFires when a print template is destroyed.
PrivacyImpactedStateChangeFired when an event occurs that impacts privacy, or when a user navigates away from a URL that has impacted privacy.
ProgressChangeFires when the progress of a download operation is updated on the object.
PropertyChangeFires when the PutProperty method of the object changes the value of a property.
RedirectXDomainBlockedFired when a cross-domain redirect request is blocked.
SetPhishingFilterStatusFires to indicate the progress and status of Microsoft Phishing Filter analysis of the current webpage.
SetSecureLockIconFires when there is a change in encryption level.
StatusTextChangeFires when the status bar text of the object has changed.
ThirdPartyUrlBlockedFired when a third-party URL is blocked.
TitleChangeFires when the title of a document in the object becomes available or changes.
UpdatePageStatusNot implemented.
WindowActivateNot implemented.
WindowClosingFires when the window of the object is about to be closed by script.
WindowMoveNot implemented.
WindowResizeNot implemented.
WindowSetHeightFires when the object changes its height.
WindowSetLeftFires when the object changes its left position.
WindowSetResizableFires to indicate whether the host window should allow resizing of the object.
WindowSetTopFires when the object changes its top position.
WindowSetWidthFires when the object changes its width.
WindowStateChangedFires when the visibility state of a content window, such as the browser window or a tab, changes.
Enumerations
RefreshConstantsContains values used with the Refresh2 method.
SecureLockIconConstantsContains values used by the SetSecureLockIcon event.
Constants
NavigateError Event Status CodesThis page lists the possible values for the StatusCode parameter of the NavigateError event handler. These navigation-related error values are extracted from two documents: HTTP Status Codes and URL Moniker Error Codes. Follow the link for the status code you are interested in for a description of its meaning.