25

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

AEM
  • 1,354
  • 8
  • 20
  • 30
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047

4 Answers4

28

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.

AEM
  • 1,354
  • 8
  • 20
  • 30
Gishu
  • 134,492
  • 47
  • 225
  • 308
11

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.

AEM
  • 1,354
  • 8
  • 20
  • 30
Mauro
  • 4,531
  • 3
  • 30
  • 56
3

Mauro is right about the shortcuts, they're in Express as well. You can also get to the Comment/Uncomment block commands in the Edit->Advanced menu. You probably also have a toolbar icon to do this that looks like a couple of lines, with a few indented blue ones.

MovEaxEsp
  • 389
  • 2
  • 3
3

Visual Assist X also has better shortcuts for this:

/ - comment the block with //
* - comment the block with /* */

I'm not sure if it Visual Assist works with The express edition though

shoosh
  • 76,898
  • 55
  • 205
  • 325