This documentation is archived and is not being maintained.

10.6.1 Static and instance properties

Visual Studio .NET 2003

When a property declaration includes a static modifier, the property is said to be a static property. When no static modifier is present, the property is said to be an instance property.

A static property is not associated with a specific instance, and it is a compile-time error to refer to this in the accessors of a static property.

An instance property is associated with a given instance of a class, and that instance can be accessed as this (Section 7.5.7) in the accessors of that property.

When a property is referenced in a member-access (Section 7.5.4) of the form E.M, if M is a static property, E must denote a type containing M, and if M is an instance property, E must denote an instance of a type containing M.

The differences between static and instance members are discussed further in Section 10.2.5.