Jimbo99999
asked on
Vb.Net equivalent of VB6 HTMLElement.Click
Good Day Experts!
Yet another first here that I hope you can help me out with.
I converted a little VB6 project to Vb.Net(2005). I am having trouble with some HTML in it.
Dim x As HTMLHtmlElement
Dim xc As IHTMLElementCollection
For Each x In xc
If InStr(x.outerHTML, "Enter") > 0 Then
Set submitElement = x
Exit For
End If
Next
submitElement.Click
The trouble I am having is finding the VB.Net equivalent for the .Click on submitElement.
Please ask questions as I am out of ideas after a a few hrs of trying.
Thanks,
jimbo99999
Yet another first here that I hope you can help me out with.
I converted a little VB6 project to Vb.Net(2005). I am having trouble with some HTML in it.
Dim x As HTMLHtmlElement
Dim xc As IHTMLElementCollection
For Each x In xc
If InStr(x.outerHTML, "Enter") > 0 Then
Set submitElement = x
Exit For
End If
Next
submitElement.Click
The trouble I am having is finding the VB.Net equivalent for the .Click on submitElement.
Please ask questions as I am out of ideas after a a few hrs of trying.
Thanks,
jimbo99999
ASKER
Thanks for your response. I will hope to get back to this little project this afternoon.
jimbo99999
jimbo99999
Equivalent in VB.NET would be
submitElement.RaiseEvent(" Click")
submitElement.RaiseEvent("
ASKER
Hello everyone...finally able to get back on this project.
I am just trying submitElement.RaiseEvent(" Click") now and am receiving an error.
"An unhandled exception of type 'System.ArgumentException' occurred in System.Windows.Forms.dll. Additional information: Value does not fall within the expected range".
The messagebox has two button labelled <Break> and <Continue>. My breakpoint is now green with an error in the left margin.
Any ideas? I am starting my search now.
Thanks,
jimbo99999
I am just trying submitElement.RaiseEvent("
"An unhandled exception of type 'System.ArgumentException'
The messagebox has two button labelled <Break> and <Continue>. My breakpoint is now green with an error in the left margin.
Any ideas? I am starting my search now.
Thanks,
jimbo99999
Does it work with
submitElement.RaiseEvent(" click")
?
submitElement.RaiseEvent("
?
ASKER
Yes. I received the above error using it.
You replied "Yes" to my question "Does it work with following" but also said you received an error. So does it work or do you still receive the same error?
ASKER
I apolgize, it was late when I responded.
I receive the error using submitElement.RaiseEvent(" click").
I was just trying anything I could find while searching on the net. This is working but I don't understand why:
submitElement.InvokeMember ("Click")
Thanks,
jimbo99999
I receive the error using submitElement.RaiseEvent("
I was just trying anything I could find while searching on the net. This is working but I don't understand why:
submitElement.InvokeMember
Thanks,
jimbo99999
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks for your efforts...they led to make that discovery soultion.
Have a good day,
jimbo99999
Have a good day,
jimbo99999
I only ask because there may be a better way to achieve what you want rather than attempting a like-for-like conversion.