- 2 minutes to read
Region Painting paints region directives (#region, #endregion) in the code editor. This reduces visual noise and makes the code clearer.
Press Ctrl + 3 to create a region around a method, property or selection.
Region Painting is available in C#, Visual Basic, and XAML. The following screenshot shows this feature in XAML:
To see a region directive: put the caret on a line that has a region painting.
To collapse or expand the code region, do the following:
- Place the caret at the beginning of the line which contains the #region or #endregion directive.
- Press Space.
How to Enable
Use one of the following ways to enable Region Painting:
1) Click the “Region Painting” button on the CodeRush Visualize toolbar.
2) Use the Quick Setup options page.
Click “Options…” item in the CodeRush menu to access the “CodeRush Options” page.
Select the “Quick Setup” options page in the tree view and enable the “Region Painting” option.
Press OK to apply the change and close the Quick Setup options page.
3) Enable the corresponding option in the Editor | All Languages | Region Painting options page.