gpt4 book ai didi

visual-studio-2010 - Visual Studio 2010 : highlight CSS text and comment

转载 作者:行者123 更新时间:2023-12-04 06:28:29 25 4
gpt4 key购买 nike

考虑将要注释掉的 Visual Studio 2010 中 .css 文件中的 CSS 代码片段。

alt text

通常 Ctrl + E , Ctrl + C 将注释您选择的 HTML 和其他源代码。

但是突出显示 CSS 代码并执行该快捷方式组合会导致一条警告消息:

The key combination is bound to command (Comment Selection) which is not currently available.



Visual Studio 2010 中是否有工具栏或键盘快捷键可以为您注释突出显示的 CSS 文本?

最佳答案

注释选择命令不适用于 css 文件。

但是,您可以创建一个简单的宏并为其分配键盘快捷键...

Sub CommentCSS()
Dim selection As String
selection = DTE.ActiveDocument.Selection.Text
selection = "/*" + selection + " */"
DTE.ActiveDocument.Selection.Text = selection
End Sub

要“取消注释”选择,请使用另一个简单的宏:
Sub UncommentCSS()
Dim selection As String
selection = DTE.ActiveDocument.Selection.Text
selection = selection.Remove(0, 2)
selection = selection.Remove(selection.Length - 2, 2)
DTE.ActiveDocument.Selection.Text = selection
End Sub

关于visual-studio-2010 - Visual Studio 2010 : highlight CSS text and comment,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2557844/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com