single instance base class

G

Guest

I want to have a single instance of a base class that all the child classes
inherits from.
The base class is going load data from text files and this only needs to be
done once.
What I don't need is every time a child class is created that it goes out
and creates another instance of the base class, which then would go out and
load data from those text files.

Am I making sence here?
How can I do this in VB.Net?

Thanks

Mike w.
 
K

Ken Tucker [MVP]

Hi,

Added shared members to your class.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vakeyShared.asp

Ken
--------------------
I want to have a single instance of a base class that all the child classes
inherits from.
The base class is going load data from text files and this only needs to be
done once.
What I don't need is every time a child class is created that it goes out
and creates another instance of the base class, which then would go out and
load data from those text files.

Am I making sence here?
How can I do this in VB.Net?

Thanks

Mike w.
 

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