This is what I have:
public void initiate(WebBrowser browser)
{
browser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(refDocumentCompleted);
// navigate browser to the referal Uri
browser.Navigate(refreral);
browser.DocumentCompleted -= refDocumentCompleted;
//remove here so that it doesn't do this everytime a document is completed, i want it just in this method
}
private void refDocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
// want to call navigate method on browser here. but Its out of scope.
}
What I would like it to do is, navigating to referral, then once that is loaded navigate to another page stored as a global string in the class.
I’m sure my trouble here is from a poor understanding of how events work, I’ve tried to read up on it, but can’t seem to get my head around it but don’t think I need to create my own handler.
You already have the webbrowser object. You just need to cast it:
etc.