WebBrowser: Programmaticaly click an image button

  • Thread starter Thread starter nime
  • Start date Start date
N

nime

I got an image button in a form. I want to simulate a click through programming.
There is no Click method for HTMLElement. I tried el.RaiseEvent("Click")
instead and an error occured.

How can I click the image button?

For Each el In frm.All
If el.TagName.ToString = "INPUT" Then
Debug.Print(el.OuterHtml)
If el.GetAttribute("type") = "image" Then
If el.GetAttribute("Value") = "Login" Then
el.RaiseEvent("Click")
Exit For
End If
End If
End If
Next el
 
Hello nime,

Well, you either click the button to submit the form.. in which case you
want to call Form.submit()... or you click the button to invoke a click handler
(<img onclick="someJSFunction()">).. in which case you call the function
direct.

-Boo
 
Back
Top