I have the below code that looks for a textbox on the webbrowsercontrols current webpage, and sets focus on it.
When i run my app, it throws the errro below. if i press "yes" everything works fine, if i put "supress errors" option in the webbrowsercontrol, no errors but dosent work.
Here is code.
Code:Dim htmlEl As HtmlElementCollection = WebBrowser1.Document.All Dim iEnum As System.Collections.IEnumerator = htmlEl.GetEnumerator() While iEnum.MoveNext() Dim temp As HtmlElement = DirectCast(iEnum.Current, HtmlElement) If temp.Name.Trim().ToLower().Equals("status") Then temp.InnerText = TextBox1.Text temp.InvokeMember("focus") Dim htmlEls As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("input") For Each htmle As HtmlElement In htmlEls If htmle.GetAttribute("value").Contains("Share") Then SendKeys.Send("{TAB}") SendKeys.Send("{ENTER}") End If Next End If End While





Reply With Quote