Hey Mike,
I load the web page into a web control. When I change some textboxes/inputs
I then execute the onclick for the form using InvokeMember. This runs but
the reply comes up in IE not the web control. The web master does this for
all such forms!!! Arg!
If there is a better way please let me know! Sure wish they used Web
Services though!!!
However, I have found a solution, see
http://support.microsoft.com/kb/176792
For the people who are interested I included my code (below) as this method
is not that friendly.
My webcontrol loads this page.
http://www.edmonton.ca/portal/serve...control=SetCommunity&CommunityID=218&PageID=0
In the top right corner of this page you will see "Today's Bus Stop
Schedule". Using a webcontrol I fill in the bus stop, (eg. 1468), as needed
and run the onclick. On the reply page the code below will ferret out the
info I need. If your interested use bus stop id 1468.
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
'
' ShDocVw & msHTML dll's
' You have to add these two dll's.
' They are found in the \windows\system32 folder
' To add shdocvw you may have to add the shdocvw.tlb - tells VS
how/what to add
'
' Variables IE an SWs are globally declared (msHTML, ShDocVw
respectively)
' Info from web page reply i need
Dim bsTime As String
Dim bsRoute As String
For Each IE In SWs
'locate my reply page
If IE.LocationName.Contains("Bus Stop Schedule") Then
'must have a mshtml.htmldocument to access GetElementById
'Note cannot cType to system.windows.forms.htmldocument
Dim IEDoc As mshtml.HTMLDocument = IE.Document
'Get an htmlelement
'note cannot convert to an htmlelement so object is used
Dim elementGetItem As Object =
IEDoc.getElementById("dgdBusSchedule__ctl1_lblDepartureDate")
'elementGetItem is in fact an htmlelement so I can use it as
such - no intellisence
bsTime = elementGetItem.innertext
elementGetItem =
IEDoc.getElementById("dgdBusSchedule__ctl1_lnkRouteNumber")
bsRoute = elementGetItem.innertext
MessageBox.Show("Next bus @: " & bsTime, "Bus Route: " &
bsRoute)
Exit For
End If
Next
End Sub