本文介绍了更改ctrl k + c以在Visual Studio中生成c样式注释(//)的c样式注释(/**/)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将Visual Studio中使用的评论样式从//更改为/*...*/?
How do i change the comment style used in visual studio from // to /*...*/ ?
我主要使用注释快捷方式暂时注释掉代码.
I use the comment shortcut mostly for commenting out code temporarily.
如果我在下面的代码中选择bool abc并按ctrl k + c
It annoys me that if i select bool abc in the code below and press ctrl k+c
void func( bool abc ) {}它产生
//void func( bool abc ) {}代替
void func( /*bool abc*/ ) {}致谢
亨里克
推荐答案您可以使用宏来实现.使它看起来像这样:
You can do it with a macro. Make it look like this:
Public Sub CommentSelection() If Not DTE.ActiveDocument.Selection.IsEmpty Then DTE.ActiveDocument.Selection.Text = "/* " + DTE.ActiveDocument.Selection.Text + " */" End If End Sub将其绑定到Ctrl-K + C以外的其他键,则需要将其保留.
Bind it to a key other than Ctrl-K+C, you'll want to keep that one around.
更多推荐
更改ctrl k + c以在Visual Studio中生成c样式注释(//)的c样式注释(/**/)
发布评论