Accessing object without instanciate it???

  • Thread starter Thread starter serge calderara
  • Start date Start date
S

serge calderara

Dear all,

what is the way to declare an object, that when it is use,
we do not need to instance it by the new keyword.

Similar way as the Trace and Debug class.

I have made a class which handle user message error and
loging, and would like to get that object to be access
like :

MessageProvider.Display()

instead of

dim myMessageProvider as new MessageProvider
myMessageProvider.Display()

thnaks for your help
 
serge calderara said:
what is the way to declare an object, that when it is use,
we do not need to instance it by the new keyword.

Similar way as the Trace and Debug class.

I have made a class which handle user message error and
loging, and would like to get that object to be access
like :

MessageProvider.Display()

instead of

dim myMessageProvider as new MessageProvider
myMessageProvider.Display()

You need to make your method static (shared in VB.NET).
 
Back
Top