Patrick wrote:[color=blue]
> Hello - I'm finishing my VB class - and working on a project - I am using
> Microsoft Technet Article 828993 on Ping an IP address by using sockets in
> visual basic .net.
> (
http://support.microsoft.com/default...b;en-us;828993) What i'd
> like to do is modify this application to graphically ask for IP address,
> pass it to the module, and return the value to the application - OK - I know
> passing values between forms is very popular here and I understand how to do
> that - but is there a difference passing info to a module?
>
> Don't have to be explicit - I want to learn this - but a link would be
> helpful, just that the module uses Sub Main () so I modified the module and
> added
>
> Dim objIPUpdateForm As New frmIPUpdate
> objIPUpdateForm.ShowDialog()
>
> Set the property pages to launch Sub Main( ) and I have my form loaded
> waiting for data. I tried methodologies for standard form to form data
> transfer, but no soap.
>
> Sorry if this is beat to death, just we haven't gone into much Module detail
> other than using it as a Mainline to open forms, splashscreens and whatnot.
>
>[/color]
Something like this is what I think you are looking for:
Sub Main()
Dim objIPUpdateForm As New frmIPUpdate
objIPUpdateForm.ShowDialog()
Dim IP as String = objIPUpdateForm.GetIPProperty
'Do Ping Stuff Here
End Sub
Class frmIPUpdate
.....
Public Property ReadOnly GetIPProperty as String
Get
return m_FormsIPAddress
End Get
End Property
.....
End Class
So, we added a public property to the form that exposes the ip address
from the form. You will have to do some checking to make sure a valid
IP was returned, but that's the basics
Chris