
Returns or sets a value that determines whether the toolbar is visible.
object.ToolBar [= value]
Part Description object Required. An object expression that evaluates to an InternetExplorer object. value Optional. A Boolean expression that determines whether the toolbar is visible. If TRUE, the toolbar is visible; if FALSE, it is hidden. The default is TRUE.
The WebBrowser object ignores the ToolBar property.
Returns or sets the distance between the internal top edge of the WebBrowser control and the top edge of its container.
object.Top [= value]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. value Optional. A long integer expression that specifies the distance.
The Top property is measured in units depending on the coordinate system of its container. The values for this property change as the object is moved by the user or by code.
Returns a Boolean value indicating whether the given object is a top-level container.
object.TopLevelContainer
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
Returns a string expression that specifies the type name of the contained document objectthat is, "Windows HTML Viewer."
object.Type
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
Returns or sets a value indicating whether the object is visible or hidden.
object.Visible [= value]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. value Optional. A Boolean expression specifying the visible state of Internet Explorer. If TRUE, the window is visible; if FALSE, it is hidden. The default value is FALSE.
Although the Internet Explorer application is hidden when it is first created, it becomes visible after using the Navigate or GoSearch method.
Returns or sets the horizontal dimension, in pixels, of the frame window that contains the WebBrowser control.
object.Width [= width]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. width Optional. A long integer value that specifies the horizontal dimension of the frame window, in pixels.
This section describes the methods associated with the WebBrowser control.
Converts the client coordinates of a point to window coordinates. Client coordinates are relative to the upper-left corner of the client area; window coordinates are relative to the upper-left corner of a window.
object.ClientToWindow pcx, pcy
Part Description object Required. An object expression that evaluates to an object in the Applies To list. pcx Required. A long integer value that specifies the x-coordinate of the point in client coordinates. When ClientToWindow returns, this variable contains the x-coordinate of the point in window coordinates. pcy Required. A long integer value that specifies the y-coordinate of the point in client coordinates. When ClientToWindow returns, this variable contains the y-coordinate of the point in window coordinates.
Executes a command on an OLE object and returns the status of the command execution using the IOLECommandTarget interface.
object.ExecWB nCmdID, nCmdExecOpt, [pvaIn], [pvaOut]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. nCmdID Required. A long integer that represents the identifier of the command to execute. nCmdExecOpt Required. A long integer that represents the options set for executing the command. pvaIn Optional. A variant used for specifying command input arguments. pvaOut Optional. A variant used for specifying command output arguments.
Retrieves the current value of a property associated with the given object.
object.GetProperty szProperty, vtValue
Part Description object Required. An object expression that evaluates to an object in the Applies To list. szProperty Required. A string expression that contains the name of the property to retrieve. vtValue Required. A variable that receives the current value of the property.
Navigates backward one item in the history list.
object.GoBack
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
During a browsing session, the WebBrowser control and Internet Explorer application maintain a history list of all Web sites visited during a session (unless you specify the navNoHistory flag when using the Navigate method). Use the CommandStateChange event to check the enabled state of backward navigation. If the event's CSC_NAVIGATEBACK command is disabled, the beginning of the history list has been reached and the GoBack method should not be used.
Navigates forward one item in the history list.
object.GoForward
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
During a browsing session, the WebBrowser control and Internet Explorer application maintain a history list of all Web sites visited during a session (unless you specify the navNoHistory flag when using the Navigate method). Use the CommandStateChange event to check the enabled state of forward navigation. If the event's CSC_NAVIGATEFORWARD command is disabled, the end of the history list has been reached and the GoForward method should not be used.
Navigates to the current home or start page, as specified in the Internet Explorer Options dialog box and Internet Control Panel.
object.GoHome
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
Navigates to the current search page, as specified in the Internet Explorer Options dialog box and Internet Control Panel.
object.GoSearch
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
Navigates to the resource identified by a Universal Resource Locator (URL) or to the file identified by a full path.
object.Navigate URL [Flags,] [TargetFrameName,] [PostData,] [Headers]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. URL Required. A string expression that evaluates to the URL, full path or the Universal Naming Convention (UNC) location and name of the resource to display. Flags Optional. A constant or value that specifies whether to add the resource to the history list, whether to read from or write to the cache, and whether to display the resource in a new window. It can be a combination of the following constants or values.
Constant Value Meaning navOpenInNewWindow 1 Open the resource or file in a new window. navNoHistory 2 Do not add the resource or file to the history list. The new page replaces the current page in the list. navNoReadFromCache 4 Do not read from the disk cache for this navigation. navNoWriteToCache 8 Do not write the results of this navigation to the disk cache. TargetFrameName Optional. A string expression that evaluates to the name of an HTML frame in URL to display in the browser window. The possible values for this parameter are:
_blank Specifies to load the link into a new unnamed window. _parent Specifies to load the link into the immediate parent of the document the link is in. _self Specifies to load the link into the same window the link was clicked in. _top Specifies to load the link into the full body of the current window. <window_name> A named HTML frame. If no frame or window exists that matches the specified target name, a new window is opened for the specified link. PostData Optional. Data to send to the server during the HTTP POST transaction. For example, the POST transaction is used to send data gathered by an HTML form to a program or script. If this parameter does not specify any post data, the Navigate method issues an HTTP GET transaction. This parameter is ignored if URL is not an HTTP URL. Headers Optional. A value that specifies additional HTTP headers to send to the server. These headers are added to the default Internet Explorer headers. The headers can specify things like the action required of the server, the type of data being passed to the server, or a status code. This parameter is ignored if URL is not an HTTP URL.
The WebBrowser control or InternetExplorer object can browse to any location in the local file system, on the network, or on the World Wide Web. Use the Navigate method to tell the browser which location to browse to. By including a text box in your application, you can let the user specify the location to browse to and then pass the location to the Navigate method.
Navigates to the resource identified by a Universal Resource Locator (URL) or to the file identified by a full path. The Navigate2 method extends the Navigate method to support browsing on special folderssuch as Desktop and My Computerthat are represented by a pointer to an item identifier list (PIDL). However, this is not applicable to the Visual Basic programming language. For information on this functionality, see the Using the WebBrowser Control from C/C++ section.
object.Navigate2 URL [Flags,] [TargetFrameName,] [PostData,] [Headers]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. URL Required. A string expression that evaluates to the URL of the resource to display or the full path to the file location. Flags Optional. A constant or value that specifies whether to add the resource to the history list, whether to read from or write to the cache, and whether to display the resource in a new window. It can be a combination of the following constants or values.
Constant Value Meaning navOpenInNewWindow 1 Open the resource or file in a new window. navNoHistory 2 Do not add the resource or file to the history list. The new page replaces the current page in the list. navNoReadFromCache 4 Do not read from the disk cache for this navigation. navNoWriteToCache 8 Do not write the results of this navigation to the disk cache. TargetFrameName Optional. A string expression that evaluates to the name of an HTML frame in URL to display in the browser window. The possible values for this parameter are:
"_blank" Specifies to load the link into a new unnamed window. "_parent" Specifies to load the link into the immediate parent of the document the link is in. "_self" Specifies to load the link into the same window the link was clicked in. "_top" Specifies to load the link into the full body of the current window. <window_name> A named HTML frame. If no frame or window exists that matches the specified target name, a new window is opened for the specified link. PostData Optional. Data to send to the server during the HTTP POST transaction. For example, the POST transaction is used to send data gathered by an HTML form to a program or script. If this parameter does not specify any post data, the Navigate2 method issues an HTTP GET transaction. This parameter is ignored if URL is not an HTTP URL. Headers Optional. A value that specifies additional HTTP headers to send to the server. These headers are added to the default Internet Explorer headers. The headers can specify things like the action required of the server, the type of data being passed to the server, or a status code. This parameter is ignored if URL is not an HTTP URL.
Sets the value of a property associated with the given object.
object.PutProperty szProperty, vtValue
Part Description object Required. An object expression that evaluates to an object in the Applies To list. szProperty Required. A string expression that contains the name of the property to set. vtValue Required. A variable that specifies the new value of the property.
Queries an OLE object and returns the status of commands using the IOLECommandTarget interface.
object.QueryStatusWB nCmdID
Part Description object Required. An object expression that evaluates to an object in the Applies To list. nCmdID Required. A long integer that represents the identifier of the command on which the caller needs status information. This will be one of the OLECMDID values.
Returns an unsigned long that is one of the OLECMDF values.
Closes the Internet Explorer application.
object.Quit
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
Reloads the page currently displayed in the WebBrowser control.
object.Refresh
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
The WebBrowser control and Internet Explorer application store Web pages from recently visited sites in cached memory on the user's hard disk. This saves time when revisiting a site by reloading the page from the local disk rather than downloading it again across the network from the remote HTTP server. You can force the WebBrowser control or Internet Explorer application to redownload a page by using the Refresh or Refresh2 method to ensure that you are viewing the most current version of the page. Also, you can disable the cache from being used by specifying the navNoReadFromCache and navNoWriteToCache flags when calling the Navigate or Navigate2 method.
Reloads the page currently displayed in the WebBrowser control. Unlike the Refresh method, this method contains a parameter that specifies the refresh level.
object.Refresh2 [Level]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. Level Optional. A constant or value that specifies the refresh level. It can be one of the following constants or values.
Constant Value Meaning REFRESH_NORMAL 0 Perform a lightweight refresh that does not include sending the HTTP "pragma:nocache" header to the server. REFRESH_IFEXPIRED 1 Perform a lightweight refresh if the page has expired. REFRESH_COMPLETELY 3 Perform a full refresh that includes sending a "pragma:nocache" header to the server (HTTP URLs only).
The "pragma:nocache" header tells the server not to return a cached copy. This ensures that the information is as fresh as possible. Browsers typically send this header when the user selects refresh, but the header can cause problems for some servers.
Shows or hides a specified browser bar.
object.ShowBrowserBar pvaClsid, [pvarShow,] [pvarSize]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. pvaClsid Required. A string containing the class identifier of the browser bar to show or hide. This object must be registered as an Explorer Bar object with the CATID_InfoBand component category. For more information, see Band Objects. The standard browser bars use the following class identifiers:
Browser Bar Name Class ID Search {30D02401-6A81-11D0-8274-00C04FD5AE38} Favorites {EFA24E61-B078-11D0-89E4-00C04FC9E26E} History {EFA24E62-B078-11D0-89E4-00C04FC9E26E} Channels {EFA24E63-B078-11D0-89E4-00C04FC9E26E} pvarShow Optional. A Boolean value that specifies whether the browser bar should be shown or hidden. If this is True, the browser bar is shown. If this is False, the browser bar is hidden. The default value is True. pvarSize Optional. Not currently used.
Browser bars, also known as Explorer Bars, can be shown or hidden by the user from Internet Explorer's View menu. The ShowBrowserBar method is ignored by the WebBrowser object.
Cancels any pending navigation or download operation and stops any dynamic page elements, such as background sounds and animations.
object.Stop
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
Before calling the Stop method, you can use the object's Busy property to determine if the browser is currently in the process of navigating to a new location or downloading a file.
BeforeNavigate2, Busy, DownloadBegin, ProgressChange, Refresh, Refresh2
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.