Tried everything that was posted on Stack, even mshtml.IHTMLElement nativeElement = el
as mshtml.IHTMLElement;
nativeElement.click()
didn't work.
This code below is standard and works for me on other button clicks in the WebBrowser
control.
HtmlElementCollection pageTextElements = doc.Window.Document.GetElementsByTagName("input");
HtmlElement btnOK = null;
foreach (HtmlElement element in pageTextElements)
{
if (element.Id == "btnOK")
{
btnOK = element;
}
}
btnOK.InvokeMember("click");
//This is the button I'm trying to click:
<input id="btnOK" class="btn12" type="submit" value="OK" title="" tabindex="11" style="position: absolute; left: 584px; height: 21px; width: 63px; …pointer; top: 1074px; padding-left: 0px; padding-right: 0px;" onfocus="saveFocusedControl("btnOK");" name="btn_btnOK" alt="OK" accesskey="O"></input>