| title | #Region Directive | ||||
|---|---|---|---|---|---|
| ms.date | 07/20/2015 | ||||
| ms.prod | .net | ||||
| ms.suite | |||||
| ms.technology |
|
||||
| ms.topic | article | ||||
| f1_keywords |
|
||||
| helpviewer_keywords |
|
||||
| ms.assetid | 90a6a104-3cbf-47d0-bdc4-b585d0921b87 | ||||
| caps.latest.revision | 14 | ||||
| author | dotnet-bot | ||||
| ms.author | dotnetcontent |
Collapses and hides sections of code in Visual Basic files.
#Region "identifier_string"
#End Region
| Term | Definition |
|---|---|
identifier_string |
Required. String that acts as the title of a region when it is collapsed. Regions are collapsed by default. |
#End Region |
Terminates the #Region block. |
Use the #Region directive to specify a block of code to expand or collapse when using the outlining feature of the Visual Studio Code Editor. You can place, or nest, regions within other regions to group similar regions together.
This example uses the #Region directive.
[!code-vbVbVbalrConditionalComp#4]
#If...Then...#Else Directives
Outlining
How to: Collapse and Hide Sections of Code