473,472 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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

Dec 4 '06 #1
4 5040

Use the class name: myClass.MyMethod ( )
Dec 4 '06 #2
Thanks! I should have known that myself :-)

"Robinson" <bb*@bbb.comwrote in message
news:8d******************************@giganews.com ...
>
Use the class name: myClass.MyMethod ( )


Dec 4 '06 #3
Thanks! I should have known that myself :-)
>
Absolutely

:-)

Cor
Dec 5 '06 #4
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:
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
Dec 5 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: JIM.H. | last post by:
Hello, I have only one form with a listbox:lbFileContent, and I have this code in Public Class Form1. Public Shared Sub UploadFile(ByVal fileNamePath As String) Dim reader As StreamReader = New...
6
by: Martin | last post by:
I'd like to be able to get the name of an object instance from within a call to a method of that same object. Is this at all possible? The example below works by passing in the name of the object...
8
by: JPRoot | last post by:
Hi M. Jeffrey Tan, Just hopping you didn't forget me? :) Thanks JPRoot ----- \"Jeffrey Tan\" wrote: -----
4
by: Materialised | last post by:
Hi All, I have a strange issue, and I am not sure if it is a error on my part, or a visual studio bug. I am using VS.Net 2003 Enterprise. I have 2 event handlers as follows: Public...
22
by: WXS | last post by:
Sometimes a method in a class requires the use of class instance variables/fields that will not be used outside of the method itself. Currently this means you must create a instance field in the...
11
by: syssyx | last post by:
I have a "CurrentUser" object in session that I want to access from each page of a vb.net website. I can successfully access everything if I include the following at the start of each pageload: ...
24
by: M O J O | last post by:
Hi, Instead of doing this.... Public Class Form1 Public Shared Sub CreateAndShow() Dim f As New Form1 f.Show() End Sub
4
by: Pieter | last post by:
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...
2
by: hcaptech | last post by:
This is my Test.can you help me ? 1.Which of the following statement about C# varialble is incorrect ? A.A variable is a computer memory location identified by a unique name B.A variable's name...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.