How To Cause Navigation to Occur in Same WebBrowser Window (185538)
The information in this article applies to:
- Microsoft Internet Explorer (Programming) 4.0
- Microsoft Internet Explorer (Programming) 4.01
- Microsoft Internet Explorer (Programming) 5
- Microsoft Internet Explorer (Programming) 5.5
This article was previously published under Q185538 SUMMARY
When hosting the Internet Explorer 4.x or later WebBrowser control in a Visual Basic application, you may want to have the navigation always occur in your application and not other Internet Explorer windows. If you handle the NewWindow2 event and set the Cancel flag equal to True, navigation is
canceled completely. Since NewWindow2 does not provide you with the URL to
navigate to as the Internet Explorer 3.x NewWindow event did, there doesn't
appear to be any way to have the navigation occur in the same window.
Fortunately, Internet Explorer 4.x or later provide the WebBrowser_V1 object for compatibility with Internet Explorer 3.x. Using the WebBrowser_V1 object, you can have your application receive events from version 3.x, 4.x, and 5.x. That means that you can handle the version 3.x NewWindow event and then have the navigation occur in the current window.
REFERENCES
For additional information, please see the following article in the
Microsoft Knowledge Base:
184876 How To Use the WebBrowser Control NewWindow2 Event
For more information, see the MSDN Online Web Workshop:
(c) Microsoft Corporation 1998, All Rights Reserved. Contributions by Scott
Roberts, Microsoft Corporation
Modification Type: | Minor | Last Reviewed: | 6/29/2004 |
---|
Keywords: | kbhowto kbWebBrowser KB185538 |
---|
|