Name
Property Statement
Syntax
[Public|Private|Friend] [Default | ReadOnly| WriteOnly] _
[ClassBehavior] Property name _
[(arglist)] [As type]
Get
[statements]
End Get
Set
[statements]
End Set
End Property-
Public Use: Optional
Type: Keyword
Gives the property scope through all procedures in all modules in the project. If used within a createable class module, the property is also accessible from outside the project.
Public,Private, andFriendare mutually exclusive.-
Private Use: Optional
Type: Keyword
Restricts the scope of the property to those procedures within the same module.
Public,Private, andFriendare mutually exclusive.-
Friend Use: Optional
Type: Keyword
Only valid in a class module, it gives the property scope to all modules within a project, but not to modules outside the project.
Public,Private, andFriendare mutually exclusive.-
Default Use: Optional
Type: Keyword
Specifies that the property is the default property. Must have both a Get and a Set block.
-
ReadOnly Use: Optional
Type: Keyword
Indicates that the property is read-only. Must have only a Get block. (If you try to write a Set block, VB will generate a syntax error.)
-
WriteOnly Use: Optional
Type: Keyword
Indicates that the property is write-only. Must have only a Set block. (If you try to write a Get block, VB will generate a syntax error.)
-
ClassBehavior Use: Optional
Type: Keyword
One of the following keywords:
-
Overloads Indicates that more than one declaration of this function exists (with different ...
-
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access