Visual Studio Tips: Shortcut for Collapse/Expand code blocks

While developing windows/web – application using Visual Studio, several times we need to collapse/expand the code blocks/regions for clear reading and easy to manage the whole page of code. We do it by clicking the +/- sign on the left of the start of code block. But, when there is a good no. of code blocks/sections/regions then clicking each +/- sign is difficult. If the code blocks are large in size i.e, contain many lines of code then practically it is again a hard task to manage the code.

This difficulty can be avoided if we use following shortcuts –

1.  CTRL + M + M       —–>  Collapse/Expand current section

2.  CTRL + M + O       —–>   Collapse all regions

3.  CTRL + M + L       —–>   Expand all regions


You may also like-

Shortcut for Bookmark in Visual Studio


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s