Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need hotkey/button to comment out a block of code in Visual Studio 2008 Express

Tags:

I'm coming from Eclipse, working in Visual Studio 2008 Express and just want to highlight code, right-click and comment it out.

  • nothing in right-click
  • looking in Tools | Options, Toolbars, Commands, can't find a button for it...

How do I activate this the comment/uncomment feature, I know Visual Studio 2003 had it.

HERE ARE THE ANSWERS, TURNS OUT IT DEPENDS WHAT YOU ARE USING:

Visual Studio 2008 Full Version:

Comment Ctrl-K , Ctrl-C
Uncomment Ctrl-K , Ctrl-U

Visual Web Developer 2008 Express:

Comment Ctrl-K , Ctrl-C
Uncomment Ctrl-K , Ctrl-U

Visual C# 2008 Express:

Comment Ctrl-E , Ctrl-C
Uncomment Ctrl-E , Ctrl-U

like image 559
Edward Tanguay Avatar asked Nov 23 '08 15:11

Edward Tanguay


People also ask

How do you comment a whole block of code in Visual Studio?

Windows: Ctrl + K + U. Mac: Command + K + U.

How do you comment a block of code shortcut?

Comments can be added to single lines of code (Ctrl + /) or blocks of code (Ctrl + Shift + /).


2 Answers

Weird it's Ctrl+E, C (Comment) and Ctrl+E, U (Uncomment)

Normally It's Ctrl+K, C and Ctrl+K, U as Mauro says. Express Edition default (and only) keyboard mapping says otherwise.

like image 140
Gishu Avatar answered Oct 07 '22 23:10

Gishu


the key combination

Comment Ctrl-K , Ctrl-C
Uncomment Ctrl-K , Ctrl-U

That's VS 2008, not sure if the express editions have the same thing.

like image 23
Mauro Avatar answered Oct 08 '22 01:10

Mauro