Shared Methods in VB 2005 Beta 2

  • Thread starter Thread starter Michael D. Ober
  • Start date Start date
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.
 
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".
 
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.
 
Back
Top