WebBrowser 2005 : Handling dialog boxes
Occasionally, the web page navigated to will create a dialog box alerting the user to something that then requires the 'OK' button to be pressed. Of course, this will stop my application from any more automation until the dialog is closed.
I have tried using 'SendKeys.send' for the enter key and spacebar in the 'document_completed' event but that event fires before the message box has focus. Even if it did work, it seems like a hack, since I am just blindly sending this keystroke.
I would prefer to be able to either disable the message box. A 'silent' property (http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrowser/webbrowser.asp) to disable message boxes used to be available but is not in the 2005 version.
OR
I would like to get a handle on this dialog box and control in a more civilized manner that just doing a 'sendkeys'. This would allow me to do 'if...then' on the message contents.
Can anyone please point me in a direction on this?
Thanks,
Richard

