Link to home
Start Free TrialLog in
Avatar of BigBoss
BigBoss

asked on

Web browser control in a user control - problem!

Hello,

I have developed a user control that contains the Web Browser control. I have put some code in the WebBrowser_DocumentComplete() event.

When I use this control in VB, and I call the Navigate method of the browser control (through a method of my user control), the WebBrowser_DocumentComplete() event is triggered (after the document download is complete) and my code there is executed.

However, when I use my control in an html page, the user control works fine, but when calling the Navigate method, the code does not execute. In fact, the WebBrowser_DocumentComplete() event is not triggered (entered) at all!

Does anyone know what is going wrong in the case of the html and how to solve this problem?
Please no workarounds (with timers), etc.

Please I want a solution, not only why the problem is happening (if you know why).

Thank you.
Avatar of bingie
bingie

By HTML, you mean after navigating to a site? Is the Nav_Complete event fired?
Avatar of BigBoss

ASKER

bingie...thank you for your comment.
The DocumentComplete() event is an event of the WebBrowser control that is inserted inside my VB user control, and the VB user control is being used in HTML.
In the above case, the DocumentComplete() event of the WebBrowser control is not triggered, while it is triggered when my user control is used in a VB application.

I can not use the NaviagateComplete2() event because this event is triggered before the naviagtion is actually completed, while the DocumentComplete() event is triggered after everything in the HTML page have been downloaded to the browser.

Thanks again.
ASKER CERTIFIED SOLUTION
Avatar of BigBoss
BigBoss

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial