Article ID: 185538 - Last Review: June 29, 2004 - Revision: 2.1 How To Cause Navigation to Occur in Same WebBrowser WindowThis 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. MORE INFORMATION
In order to implement this functionality in your Visual Basic application,
follow these step:
REFERENCES
For additional information, please see the following article in the
Microsoft Knowledge Base:
184876
(http://support.microsoft.com/kb/184876/EN-US/
)
How To Use the WebBrowser Control NewWindow2 Event
For more information, see the MSDN Online Web Workshop:
http://msdn.microsoft.com/workshop/
(http://msdn.microsoft.com/workshop/)
(c) Microsoft Corporation 1998, All Rights Reserved. Contributions by Scott
Roberts, Microsoft Corporation
APPLIES TO
| Article Translations
|

Back to the top
