3.3 Region Directives
Collapse the table of content
Expand the table of content
This documentation is archived and is not being maintained.

3.3 Region Directives

Visual Studio .NET 2003

Region directives group lines of source code but have no other effect on compilation. The entire group can be collapsed and hidden, or expanded and viewed, in the integrated development environment (IDE). These directives are special in that they can neither start nor terminate within a method body. For example:

Module Test
#Region "Startup code – do not edit"
    Sub Main()
    End Sub
#End Region
End Module
Start ::= [ RegionElement+ ]
RegionElement ::= RegionGroup | LogicalLine
RegionGroup ::=
   # Region StringLiteral LineTerminator
   [ LogicalLine+ ]
   # End Region LineTerminator

See Also

3.1 Conditional Compilation | 3.2 External Source Directives | #Region Directive | Collapsing and Hiding Sections of Code (Visual Basic Language Concepts)

© 2016 Microsoft