Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2010
Visual Studio
Visual C++
C/C++ Languages
 region, endregion
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2010/.NET Framework 4

Other versions are also available for the following:
Visual Studio 2010
region, endregion

#pragma region lets you specify a block of code that you can expand or collapse when using the outlining feature of the Visual Studio Code Editor.

#pragma region name
#pragma endregion comment
comment(optional)

A comment that will display in the code editor.

name(optional)

The name of the region. This name will display in the code editor.

#pragma endregion marks the end of a #pragma region block.

A #region block must be terminated with #pragma endregion.

// pragma_directives_region.cpp
#pragma region Region_1
void Test() {}
void Test2() {}
void Test3() {}
#pragma endregion Region_1

int main() {}
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker