Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
Visual Basic
Directives
 #Region Directive
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Visual Basic Language Reference 
#Region Directive 

Collapses and hides sections of code in Visual Basic files.

#Region "identifier_string"
#End Region
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. #Region statements support block semantics (such as #If...#End If), meaning that the start and end must be in the same code block.

This example uses the #Region directive.

Visual Basic
#Region "MathFunctions"
    ' Insert code for the Math functions here.
#End Region
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker