Skip to main content
A newer version of this page is available. .

Region Painting

  • 2 minutes to read

Region Painting paints region directives (#region, #endregion) in the code editor. This reduces visual noise and makes the code clearer.

Vis_Region Painting

NOTE

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:

Vis_Region Painting

To see a region directive: put the caret on a line that has a region painting.

Vis_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.

Vis_Region Painting

You can configure Region Painting in the Editor | All Languages | Region Painting options page. See the Region Painting Settings topic for more information.

How to Enable

Use one of the following ways to enable Region Painting:

1) Click the "Region Painting" button on the CodeRush Visualize toolbar.

Toolbar

2) Use the Quick Setup options page.

  • Click "Options..." item in the CodeRush menu to access the "CodeRush Options" page.

    Options

  • Select the "Quick Setup" options page in the tree view and enable the "Region Painting" option.

    QuickSetup

  • 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.

Option