The following code does not do anything for me with EO.WebBrowser.
No exceptions, but just not doing anthing.
In another browser it works fine.
Does anybody see any mistake here?
Quote: Public Sub SetFocus()
_Browser.WebView.SetFocus()
Try
Dim i&
Dim JS(100) As String
i = i + 1 : JS(i) = "var inputElements = document.getElementsByTagName('input');"
i = i + 1 : JS(i) = "for(i=0; i<inputElements.length; i++)"
i = i + 1 : JS(i) = "{"
i = i + 1 : JS(i) = " if (inputElements[i].type != 'hidden')"
i = i + 1 : JS(i) = " {"
i = i + 1 : JS(i) = " if (inputElements[i].disabled == false)"
i = i + 1 : JS(i) = " {"
i = i + 1 : JS(i) = " inputElements[i].focus();"
i = i + 1 : JS(i) = " inputElements[i].scrollIntoView(true);"
i = i + 1 : JS(i) = " break;"
i = i + 1 : JS(i) = " }"
i = i + 1 : JS(i) = " }"
i = i + 1 : JS(i) = "}"
Dim html As String = Join(JS)
_Browser.WebView.EvalScript(String.Format("(function(){{ {0} }})()", html))
Catch ex As Exception
MessageBox.Show(ex.Message.ToString)
End Try
End Sub