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

为君一笑 提交于 2019-12-20 11:13:10

问题


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

回答1:


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.




回答2:


the key combination

Comment    ctrl-k, ctrl-c
uncomment  ctrl-k, ctrl-u

Thats VS 2008, not sure if the express editions have the same thing.




回答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.




回答4:


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



来源:https://stackoverflow.com/questions/312626/need-hotkey-button-to-comment-out-a-block-of-code-in-visual-studio-2008-express

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!