English 中文(简体)
Disabling highlighting of current line in the Visual Studio editor
原标题:

The Visual Studio editor highlights the current line by changing the background color of the current line. Is there a simple way to disable this highlighting? Otherwise, which parameter in Fonts and Colors dialog controls the background color of the currently selected line in the editor?

最佳回答

Is there a simple way to disable this highlighting?

Tools -> Options -> Text Editor, in the Display group, uncheck "Highlight current line"

Which parameter in Fonts and Colors dialog controls the background color of the currently selected line in the editor?

The colors are named "Highlight Current Line (Active)" and "Highlight Current Line (Inactive)"

问题回答

To disable the border around the current line

In VS 2019

Go to : Environment -> Fonts and Colors:

Find the display item: Highlight Current Line

Set the item foreground color to: Automatic

In VS 2017 and earlier

Go to : Tools -> Options -> Text Editor:

Find the display items:

  • Highlight Current Line (Active)
  • Highlight Current Line (Inactive)

Set the item foreground color to: Automatic

if its visual code make

"editor.renderLineHighlight": "none"

The Visual Studio editor highlights the current line by changing the background color of the current line.

The only time I ve seen this is when "Use Windows High Contrast settings" is enabled (Options > Environment > General)

enter image description here

enter image description here

With this setting disabled, I just get a subtle grey box to indicate the current line (this may depend on your Color Theme):

enter image description here

If you re using Resharper, it s:

Tools -> Options -> Text Editor:

  ReSharper Current Line Highlight

press -> Ctrl + comma

Search => Render Line Highlight

select none from the options

For VsCode 2021 version users

Workspace > Text-Editor > Render Line Highlight > none

In addition to the previous answer, I d like to mention that Visual Assist (the tomato icon) also have an highlight current line feature, that can still be active while your Visual Studio highlight option is turned off. This drove me crazy! Find it in Visual Assist Option panel, Display category.

So don t forget to also uncheck the VisualAssist highlight option.

edit my settings:

  • Visual Assist option turned off
  • Visual Studio option turned on (in the Text Editors part)
  • In the font color settings, for Highlight current line (active and inactive), set the foreground to Automatic
  • Finally you can set your highlight color as you want with the background color.

Last point, sometimes Visual Studio mess things up even more, you may have to restart it, or close/open your tabs... sadly, YMMV.

Visual assist and vsvim extensions were conflicting. So I disabled it within the visual assist options.

Uncheck the option: Highlighting->Highlight results of Quick Find and Find in Files. For some reason "esc" doesn t work .





相关问题
building .net applications without Visual Studio

I m interested to hear about people working with building .net applications using MSBuild, NAnt or similar tools. What are you using, why are you using it instead of the VS IDE? I like to use ...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Visual Studio 2010 Beta 2: Can I print in color?

I have to turn in a hard copy of some code with an assignment. Is there any way in Visual Studio 2010 to print C# source code with syntax highlighting? PS: The assignment is solving a math problem, ...

Set Select command in code

On button Click I want to Set the Select command of a Gridview. I do this and then databind the grid but it doesn t work. What am i doing wrong? protected void bttnView_Click(object sender, ...

WPF design-time context menu

I am trying to create a custom wpf control, I m wondering how I can add some design-time features. I ve googled and can t seem to get to my goal. So here s my simple question, how can I add an entry ...

热门标签