Export (0) Print
Expand All
3 out of 3 rated this helpful - Rate this topic

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

A comment that will display in the code editor.


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() {}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.