更改ctrl k + c以在Visual Studio中生成c样式注释(//)的c样式注释(/**/)

编程入门 行业动态 更新时间:2024-10-28 04:23:22
本文介绍了更改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样式注释(/**/)

本文发布于:2023-11-30 00:22:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1648103.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:注释   样式   ctrl   Visual   Studio

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!