Public User Object

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

I have a class library that has a form and MDI class. My applications
use this. Each application has a MDI form inherited from the MDI
class. Each form that is displayed from within the MDI form is
inherited from the class library form. In addition to all that I have
modules in the applications.

I need an object that is available to all to store user information.
So when the MDI form is loaded, I want the form to get the user
information. But the same user information needs to be available to
all other forms and from within the modules.

My user object is a class. I need this object to be created once and
public to all. Ideas anyone? Any help would be greatly appreciated.
 
the good way :

you do not need public accessors at all , in the described situation you
could pass the user object as a parameter to the forms / modules ( avoid
modules , in a true VB.net project as they will result in VB6 like code in
the end .Net gives you the way todo things more OOP so try to use this
aproach instead )
if the object is a requirment for a other object ( always needed ) i would
pass it to the constructor

the easy way :

declare your class in a module and it is accessible


regards

Michel Posseth
 

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

Back
Top