Accessing form objects from a module

Chronis

Member
Joined
Jul 11, 2006
Messages
9
Programming Experience
Beginner
Hey all

Ah so back to my vb.net learning. Just creating a program and it's all getting too long in the one window, so I created a module to hold the code in a logical order for certain procedures, but how do I link the module to the controls on a certain form again?

Or do I have to write !frmName.Object.Property to link them from the module? All my programs have just been basic calcs and games and this is my first program over a thousand lines...How would you people do it? I really just need to order it more logically so i know where blocks of code are.

Thanks in advance for reading,
 
Modules have their uses but you should really be thinking in terms of objects. For example a card game to my mind would have a couple of separate objects....

Player
Dealer
etc...

Dont just go stuffing it all into a module, infact the only time you should use a module is if you can't think of where it would fit into it's own class, things like drawing and other utility functions. To answer your question, you dont need an instance of a module to use the methods inside. So yes you would go..

Module.Method etc...

But before all that, get object oriented. So if you have a porgram to log football scores then you would have a

Team Class
maybe a Player Class
Maybe a Score Class

in those classes put the methods that you will need to make the class 'work'
 
Back
Top