Integrating modules into application

P

Patrick

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.aspx?scid=kb;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.
 
C

Chris

Patrick said:
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.aspx?scid=kb;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.

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
 
P

Patrick

Thanks for your help - sometimes all I need is a simple answer or yes or no
answer to confirm I'm on the right track. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top