IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
VB.Net
Search VB.Net Group:

Advanced
-Collapse +Expand VB.Net To/From
To/FromCODEGuides
-Collapse +Expand VB.Net Store
PRESTWOODSTORE

Prestwood eMagazine

October Edition
Subscribe now! It's Free!
Enter your email:

   ► KBProgrammingVB.NetOOP   Print This    All Groups  
  From the February 2010 Issue of Prestwood eMag
 
VB.Net OOP:
VB.Net Self Keyword (Me)
 
Posted 12 years ago on 2/27/2009
VB.Net Code Snippet:
 A flashcard from our VB.Net Flashcards Library
 A code snippet from our VB.Net Code Snippets Page

KB101938

VB.Net Self Keyword

To refer to the current instance of a class or structure, use the Me keyword. Me provides a way to refer to the specific instance in which the code is currently executing. It is particularly useful for passing information about the currently executing instance.

The Me keyword is also used as a modifier of the first parameter of an extension method.

You cannot use Me with static method functions because static methods do not belong to an object instance. If you try, you'll get an error.

Syntax Example:
Sub SetBackgroundColor(FormName As Form)
  //FormName.BackColor = ...some color
End Sub
  
//Pass Me.
SetBackgroundColor(Me)

Comments

0 Comments.
Share a thought or comment...
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1204A1
Enter key:
Code Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile


Linked Certification Question(s)

The following are practice certification questions with answers highlighted. These questions were prepared by Mike Prestwood and are intended to stress an important aspect of this KB post. All our practice questions are intended to prepare you generally for passing any certification test as well as prepare you for professional work.

Intermediate

1 Intermediate Level Question

Question #1: Multiple Choice

Which of the following statements is true?

Answer:
1. 

To refer to the current instance of a class or structure, use the Self keyword.

2. 

To refer to the current instance of a class or structure, use the This keyword.

3. 

To refer to the current instance of a class or structure, use the Me keyword.

4. 

All of the above.

5. 

None of the above.


 KB Article #101938 Counter
10464
Since 2/27/2009
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2021 Prestwood IT Solutions.   [Security & Privacy]