Home All Groups Group Topic Archive Search About

'Me' is valid only within an instance method: Which keyword to use?

Author
4 Dec 2006 9:28 AM
Pieter
Hi,

Using VB.NET 2005:
When you use a Me.MyFunction to a Shared Method, you het the error "'Me' is
valid only within an instance method.". Which is normal.

But: Which keyword can you use instead of the "Me" to refer to a Shared
Method in the same Class? Because without the "Me" you can't use the
intellisense-stuff, and I don't like to go copy paste methods or remember
there names :-)

Is there a way to get around this?

Thansk a lot in advance,

Pieter

Author
4 Dec 2006 10:30 AM
Robinson
Use the class name:  myClass.MyMethod ( )
Author
4 Dec 2006 10:38 AM
Pieter
Thanks! I should have known that myself :-)

Show quoteHide quote
"Robinson" <b**@bbb.com> wrote in message
news:8dGdnYG-aN1YZe7YnZ2dnUVZ8sqdnZ2d@giganews.com...
>
> Use the class name:  myClass.MyMethod ( )
>
>
Author
5 Dec 2006 6:19 AM
Cor Ligthert [MVP]
> Thanks! I should have known that myself :-)
>
Absolutely

:-)

Cor
Author
5 Dec 2006 1:59 PM
rowe_newsgroups
> Because without the "Me" you can't use the intellisense-stuff, and I don't like to go copy
> paste methods or remember there names :-)

Also note that pressing Ctrl + j will bring up the intellisense menu.

Thanks,

Seth Rowe


Pieter wrote:
Show quoteHide quote
> Hi,
>
> Using VB.NET 2005:
> When you use a Me.MyFunction to a Shared Method, you het the error "'Me' is
> valid only within an instance method.". Which is normal.
>
> But: Which keyword can you use instead of the "Me" to refer to a Shared
> Method in the same Class? Because without the "Me" you can't use the
> intellisense-stuff, and I don't like to go copy paste methods or remember
> there names :-)
>
> Is there a way to get around this?
>
> Thansk a lot in advance,
>
> Pieter