Shared Methods in VB 2005 Beta 2

M

Michael D. Ober

Is there anyway to access a Shared method from within an instance of a
class.

public class MyClass
Shared Readonly Property myProp() as string
Get
return "MyProp Example"
End Get
End Property
end class

I want to use this as:

dim mc as new MyClass
debug.print mc.myProp

and

debug.print MyClass.myProp

Thanks,
Mike Ober.
 
H

Herfried K. Wagner [MVP]

Michael D. Ober said:
Is there anyway to access a Shared method from within an instance of a

"My Project" -> "Compile" -> "Instance variable accesses shared member" ->
"None".
 
M

Michael D. Ober

Thanks - After looking at this and then looking up exactly what this error
is about, I have modified my class to not use the Shared properties to
comply with the .NET programming model.

Mike.
 

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