PRB: WebBrowser Problems When Refreshing in TitleChange Handler
ID: Q179229
|
The information in this article applies to:
-
Microsoft Internet Explorer (Programming) versions 3.02, 4.0, 4.01, 5.0
-
Microsoft ActiveX SDK, version 1.0
-
Internet Client SDK, versions 4.0, 4.01
SYMPTOMS
When an application using the WebBrowser control makes a call to the
Refresh method of the WebBrowser control in an event handler for the
TitleChange event, various problems occur.
Internet Explorer 3.02 crashes with an access violation. In the other
versions of Internet Explorer mentioned at the beginning of this article,
an infinite loop occurs and the browser hangs.
CAUSE
In Internet Explorer 4.x this behavior is by design. Calling Refresh from
within a TitleChange event handler causes the WebBrowser control to fire a
TitleChange event. This infinite loop occurs if you call Refresh in
handlers for many of the WebBrowser events.
RESOLUTION
Do not call Refresh within the TitleChange event handler for the WebBrowser.
STATUS
This behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
- In Visual Basic, drop a WebBrowser control on a form.
- Add a button.
- Add the following code to the click event handler for the button:
WebBrowser1.Navigate "http://www.microsoft.com"
- Add the following code to the WebBrowser's TitleChange event handler:
Webbrowser1.Refresh
- Run the project, and click the button.
- In Internet Explorer 3.02 the application will crash. In the other
versions of Internet Explorer mentioned at the beginning of the article,
an infinite loop occurs.
Additional query words:
Keywords : kbIE500
Version : WINDOWS:1.0,3.02,4.0,4.01
Platform : WINDOWS
Issue type : kbprb