You are busy adding a WebBrowser control named, Certkiller browser to a form in a Microsoft Windows Form application. To control the navigation of the documents, you add Button controls and a TextBox control to the form, just incase a HTML document needs to e programmatically parse through the content. Which code segment should be used to create an event handler?
A.
browser.Navigated =+ delegate
{
HtmlDocument document = browser.Document;
//Parse the document
}
B.
browser.FileDownload =+ delegate
{
HtmlDocument document = browser.Document;
//Parse the document
}
C.
browser.DocumentCompleted =+ delegate
{
HtmlDocument document = browser.Document;
//Parse the document
}
D.
browser.Navigating =+ delegate
{
HtmlDocument document = browser.Document;
//Parse the document
}
Explanation:
For the DocumentComplete event, you should create an event handler. When a document is complete in the WebBrowser control, a DocumentComplete will be raised.
Incorrect Answers:
A: A Navigated for the event handler will raise after the WebBrowser control has begun with the downloading of the HTML document.
C: You should not create an event handler for the FileDownload event. This will raise when the WebBrowser downloads a file.
D: This will result in the event raise after the WebBrowser control navigates to an HTML document.