using form controls within a module


Jul 15, 2004
Programming Experience
Hello everyone, This is my first post here so i hope i got the catagory right.

Anyway the problem im having is sending info within a module back to the textboxes on the main form, I have tryed all the obvious [so i believe] solutions and have had a good look on this site, i hope someone here can help me out, thanks jaeman
Thanks but no success...

Thanks Paszt, i had already checked out the DevCity article but have had no success after implementing the changes to my project, i have attached a screenshot to try and help explain better... below is a snip of the code in the module: server.vb

Public Module TcpServerForm

Dim mainFRM As New frmMain << give access to the main form

Private Stream As NetworkStream

Public Sub Server()

' Create a new listener on port 8000.
Dim Listener As New TcpListener(8000)

mainFRM.rtbServer.Text = "About to initialize port." << sending back

So all im trying to do is send back the message to the main forms RTB...


  • problem.JPG
    27.6 KB · Views: 86
What's happening (or not happening)?

I guess the problem is in your declaration. You use the Dim statement which sets the scope of the variable to Private. Declare it using the Friend keyword.

The section in the article I linked to before (section named "A Brief Look at Scope") explains why. :)
Thanks for the reply...

Thanks Paszt, I understand what your saying so i'll have a good read through again & hopefully i'll sort it out, jaeman

Latest posts