D
Dan
I'm trying to write a Windows application that obtains
information from a web service. I can access the web
service successfully, but I can't access the object
returned by the web service in different forms.
My application is something like this:
MainForm.vb:
Public Class MainForm
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub GetResultCollection( ...
Dim WebService As New ThisWebService
Dim WebServiceResult As New ThisWebResult
Dim WebServiceElement As New ThisResultElement
WebServiceResult = WebService.getResult("parameter")
Dim ResultForm As New myResultForm
ResultForm.Show()
End Sub
End Class
myResultForm.vb:
Public Class myResultForm
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub ShowResults( ...
For Each WebServiceElement In
WebServiceResult.resultElements
myResultForm.TextBox.Text =
WebServiceElement.textfield
End Sub
End Class
Note that objects declared in MainForm are accessed in
myResultForm. And that is the problem I'm having.
I can't figure out how to make VB .NET recognize the
objects in myResultForm.
Note ... this is a "scope of variables" problem. The web
service calls all work and if I keep everything in one
form, everything works great. But I just can't get the
objects in the first form to be "seen" in the second one.
information from a web service. I can access the web
service successfully, but I can't access the object
returned by the web service in different forms.
My application is something like this:
MainForm.vb:
Public Class MainForm
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub GetResultCollection( ...
Dim WebService As New ThisWebService
Dim WebServiceResult As New ThisWebResult
Dim WebServiceElement As New ThisResultElement
WebServiceResult = WebService.getResult("parameter")
Dim ResultForm As New myResultForm
ResultForm.Show()
End Sub
End Class
myResultForm.vb:
Public Class myResultForm
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub ShowResults( ...
For Each WebServiceElement In
WebServiceResult.resultElements
myResultForm.TextBox.Text =
WebServiceElement.textfield
End Sub
End Class
Note that objects declared in MainForm are accessed in
myResultForm. And that is the problem I'm having.
I can't figure out how to make VB .NET recognize the
objects in myResultForm.
Note ... this is a "scope of variables" problem. The web
service calls all work and if I keep everything in one
form, everything works great. But I just can't get the
objects in the first form to be "seen" in the second one.