webbrowser component content change after InvokeMember("Click")

P

paul.rusu

Hi,

My Code:

// navigate browser to url
// ...

// in the document_completed event i invoke a click" event on a img
element inside the document
// ...

// this causes another document_completed event wich i handle
// ...

// now after the "Click" event there should be shown some more content
in the browser
// this content is updated but only after my code finishes and the
Browser content is displayed
// in the user interface


I have a solution particular to my problem.
while(true)
{
Appplication.DoEvents();
If (webbrowser_content.Contains("Additional Code"))
{
break;
}
}

Application.DoEvents() causes the browser to update content in the
backround but my code goes on.
The solution above is ok but i don't always know the "additional code"
so i need a general way to know when WebBrowser finished to refresh
it's content.

I need to have something like this:

while (!WebBrowser.VariableOrMethodThatTellsMeWhenContentRefreshed)
{
Application.DoEvents();
}

I appreciate a sugestion of such a way to know when the content is
rereshed. This is normally done with WebBrowserReadyState. But I am
not in normal case because the document change is caused by a "Click"
i invoke. WebBrowserStates is "Completed" in my case but i still don't
have the content.

Paul Rusu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top