You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/visual-basic/language-reference/statements/property-statement.md
+24-4Lines changed: 24 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ Property name ( [ parameterlist ] ) [ As returntype ] [ Implements implementslis
44
44
45
45
-`Default`
46
46
47
-
Optional. Specifies that this property is the default property for the class or structure on which it is defined. Default properties must accept parameters and can be set and retrieved without specifying the property name. If you declare the property as `Default`, you cannot use `Private` on the property or on either of its property procedures.
47
+
Optional. Specifies that this property is the default property for the class or structure on which it is defined. Default properties must accept parameters and can be set and retrieved without specifying the property name. If you declare the property as `Default`, you cannot use `Private` on the property or on either of its property procedures. For examples and detailed guidance, see [How to: Declare and Call a Default Property in Visual Basic](../../programming-guide/language-features/procedures/how-to-declare-and-call-a-default-property.md).
48
48
49
49
-`accessmodifier`
50
50
@@ -108,7 +108,7 @@ Property name ( [ parameterlist ] ) [ As returntype ] [ Implements implementslis
108
108
109
109
-`parameterlist`
110
110
111
-
Optional. List of local variable names representing the parameters of this property, and possible additional parameters of the `Set` procedure. See [Parameter List](parameter-list.md).
111
+
Optional. List of local variable names representing the parameters of this property, and possible additional parameters of the `Set` procedure. Parameterized properties are often used to create indexers or default properties that allow collection-like access. See [Parameter List](parameter-list.md) and [How to: Declare and Call a Default Property in Visual Basic](../../programming-guide/language-features/procedures/how-to-declare-and-call-a-default-property.md).
112
112
113
113
-`returntype`
114
114
@@ -163,7 +163,7 @@ The `Property` statement introduces the declaration of a property. A property ca
163
163
164
164
You can use `Property` only at class level. This means the *declaration context* for a property must be a class, structure, module, or interface, and cannot be a source file, namespace, procedure, or block. For more information, see [Declaration Contexts and Default Access Levels](declaration-contexts-and-default-access-levels.md).
165
165
166
-
By default, properties use public access. You can adjust a property's access level with an access modifier on the `Property` statement, and you can optionally adjust one of its property procedures to a more restrictive access level.
166
+
By default, properties use public access. You can adjust a property's access level with an access modifier on the `Property` statement, and you can optionally adjust one of its property procedures to a more restrictive access level. For detailed examples of mixed access levels, see [How to: Declare a Property with Mixed Access Levels](../../programming-guide/language-features/procedures/how-to-declare-a-property-with-mixed-access-levels.md).
167
167
168
168
Visual Basic passes a parameter to the `Set` procedure during property assignments. If you do not supply a parameter for `Set`, the integrated development environment (IDE) uses an implicit parameter named `value`. This parameter holds the value to be assigned to the property. You typically store this value in a private local variable and return it whenever the `Get` procedure is called.
169
169
@@ -205,11 +205,31 @@ The following example declares a property in a class.
For comprehensive examples of property usage, including automatic implementation, mixed access levels, and validation scenarios, see [Property Procedures](../../programming-guide/language-features/procedures/property-procedures.md).
-[How to: Create a Property](../../programming-guide/language-features/procedures/how-to-create-a-property.md)
223
+
224
+
### Advanced Property Scenarios
225
+
226
+
-[How to: Declare and Call a Default Property in Visual Basic](../../programming-guide/language-features/procedures/how-to-declare-and-call-a-default-property.md)
227
+
-[How to: Declare a Property with Mixed Access Levels](../../programming-guide/language-features/procedures/how-to-declare-a-property-with-mixed-access-levels.md)
228
+
229
+
### Related Statements and Concepts
230
+
212
231
-[Get Statement](get-statement.md)
213
232
-[Set Statement](set-statement.md)
214
233
-[Parameter List](parameter-list.md)
215
234
-[Default](../modifiers/default.md)
235
+
-[Objects and Classes](../../programming-guide/language-features/objects-and-classes/index.md)
0 commit comments