Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 1.25 KB

how-to-refer-to-the-current-instance-of-an-object.md

File metadata and controls

34 lines (26 loc) · 1.25 KB
description title ms.date helpviewer_keywords ms.assetid
Learn more about: How to: Refer to the Current Instance of an Object (Visual Basic)
How to: Refer to the Current Instance of an Object
07/20/2015
variables [Visual Basic], object
objects [Visual Basic], referring to current instance
instances [Visual Basic], referring to current
current instance
object variables [Visual Basic]
7f9b2c77-03cd-428f-adc2-b18070226e7c

How to: Refer to the Current Instance of an Object (Visual Basic)

The current instance of an object is the instance in which the code is currently executing.

You use the Me keyword to refer to the current instance.

To refer to the current instance

  • Use the Me keyword where you would normally use the name of an object variable.

    Me.ForeColor = System.Drawing.Color.Crimson  
    Me.Close()  

    Although Me behaves like an object variable, you cannot declare it or assign anything to it. Me always refers to the current instance.

See also