RAD Studio (Common)
ContentsIndex
PreviousUpNext
Regions (Delphi and C#)
Type  
Parameter  
Syntax  
{$REGION '<region description>'} and {$ENDREGION} [Delphi] or #region <region description> and #endregion [C#]  

The region and endregion directives control the display of collapsible regions in the code editor. These directives are ignored by the compiler. 

To mark code as a region, surround it with the region and endregion directives. You may include a message that will be displayed when the code is folded and hidden. 

The following code shows the use of a region in Delphi:

{$region 'Optional text that appears when the code block is folded'}
// code that can be hidden by folding
{$endregion}

The following code shows the use of a region in C#:

#region Optional text that appears when the code block is folded
// code that can be hidden by folding
#endregion
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!