Hi, I'm Jason Nguyen. I author this blog, develop software, and am a Microsoft Certified Professional.

Visual Studio Shortcut: Hide Selection

Hide Selection: Ctrl + M, Ctrl + H

Next time you want to hide some code, like in a long or convoluted method, try using this shortcut.

In the example, notice the selected code is not a distinct member of the outline initially. After using hide selection, it is; thus, it can be affected by the Visual Studio shortcuts for outlining such as toggle outlining expansion.

Hide Selection

Hide Selection

Visual Studio Shortcut: Collapse to Definitions

Visual Studio Shortcut: Toggle Outlining Expansion