06.34 Using Hide Selection

DEFAULT

Ctrl+M, Ctrl+H

VISUAL BASIC 6

Ctrl+M, Ctrl+H

VISUAL C# 2005

Ctrl+M, Ctrl+H

VISUAL C++ 2

[no shortcut]

VISUAL C++ 6

Ctrl+M, Ctrl+H

VISUAL STUDIO 6

[no shortcut]

WINDOWS

Alt, E, O, H

MENU

Edit | Outlining | Hide Selection

COMMAND

Edit.HideSelection

VERSIONS

2005 (C++ Only), 2008 (C++ Only), 2010

CODE

vstipEdit0036

Let’s say you have a chunk of code such as the following:

image with no caption

Outlining allows you to collapse only the entire method by default (minus sign in the upper-left corner of the preceding illustration). What if you want to collapse only the if statements at the top? First, select the chunk of code you want to hide.

Note

You ...

Get Coding Faster: Getting More Productive with Microsoft® Visual Studio® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.