Vadim's Weblog

Never stop learning.

Shortcut Key to Comment code in VS and SQL Server Management Studio

Posted by Vadim on October 16, 2008

When we learn any programming language, one of the firsCtrl+Ct thing  we discover is the syntax how to comment our code.  Some of you probably already have been using this shortcut key for awhile.

Select multiple lines of code and press Ctrl+K,Ctrl+C, and you hard work is going to be ignored. To reverse just press Ctrl+K,Ctrl+U

These keystrokes will comment/uncomment your code only with line comment like // in C# or — in SQL.  I’m not aware how to comment code with block comment (/**/) without using a plug-in for VS.

One more thing.  If you need to comment/uncomment a single line, you don’t need to select the whole line.  Just move the cursor to any position on the line you want to comment, and let you fingers press the magic combination.

If you like me (there’s nothing wrong to be different from me) and use ReSharper, than you would like to use Ctrl+Alt+/ with line comment and Ctrl+Shift+/ with block comment.

kick it on DotNetKicks.com

About these ads

5 Responses to “Shortcut Key to Comment code in VS and SQL Server Management Studio”

  1. Anonymous said

    good happy

  2. Anonymous said

    thank you

  3. Anonymous said

    Thx so much!

  4. Philip said

    The Shortcuts WinForms Control supports the modifier keys, multiple keys shortcuts, and Shortcuts without modifier keys to build a keyboard trigger action.

  5. […] Read More: http://vkreynin.wordpress.com/2008/10/16/shortcut-key-to-comment-code-in-vs-and-sql-server-managemen… […]

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: