Improvements to VS 2010 Text Selection

Improvements to VS 2010 Text Selection

Rate This
  • Comments 40

Brittany Behrens Brittany Behrens – Program Manager, Visual Studio Editor Team
Short Bio: I’m Brittany, a Program Manager on the Visual Studio Editor team.  Some of you may recognize me from Connect bugs or as the main voice of @VSEditor on Twitter, and I’m responsible for a variety of Editor features.  I love hearing from customers, so please let me know what you think!


As you may have noticed, text selection in Visual Studio 2010 is a bit more colorful than in previous versions.  In VS 2008 and earlier, selected text had a single foreground color and a single background color, usually white text on a navy blue background by default.  However, we have made substantial changes and improvements to the Visual Studio Editor for this release, including the new for VS 2010 ability to compose different display layers together. One of the many benefits of this is that we can combine the background color for selection with the foreground colors for a variety of other display items (plain text, keywords, comments, etc.) to show syntax coloring not only for unselected text but now for selected text as well, which we think makes selected code easier to understand.  Check out this side-by-side comparison to see the difference:

Selection in Visual Studio 2008 vs. Visual Studio 2010

In light of this new mini-feature, we intentionally disabled the foreground color option for Selected Text in Tools->Options->Environment->Fonts and Colors.  Because selected text doesn’t have a single foreground color but instead retains whatever syntax coloring it had when not selected, an option for selected text foreground color doesn’t make sense for Visual Studio 2010.  For Beta2, the Tools->Options preview for Selected Text always shows the VS 2008-style white foreground color, which we realize can be confusing.  We’ve already updated this internally so that for VS 2010 RTM, the Item Foreground Color dropdown and the Sample preview box will show your default Plain Text foreground color instead of white, giving you a more accurate idea of what selected text will look like in the editor.

This is one of many improvements we were able to make by moving the editor to WPF – hope you enjoy it!

Brittany Behrens
Program Manager, Visual Studio Editor Team

Leave a Comment
  • Please add 7 and 7 and type the answer here:
  • Post
  • ughh - no single background color has a good contrast for every possible foreground color.

  • Ingo, Greg, Don, Mike, sean:

    I'd encourage you to try noahric's extension (two comments up from this one):  Noah is a developer on the VS Editor team, so although his extension isn't officially released by Microsoft, I will say that it works as advertised.  It should give the VS 2008 and prior behavior you're looking for with a single foreground color on a single background color for selected text.

    - Brittany

  • Setting break points still has the old behavior. Why?

  • @Tanveer:

    This new behavior is specific to selection.  Breakpoints are markers and still do have a single foreground and single background color (by default, white on dark red).

    - Brittany

  • Hi there,

    I just started to get a hang of VS 2010.  Let me tell you that the first thing I started looking for is how to change the text editor default font from 'Consolas' to 'Courner New'.  Another thing that is annoying me is this Dark blue border all around.  It is really putting more strain on my eyes and I am looking for ways to get the same look and feel of the IDE as in VS 2008 or VS 2005.  Hope you can help me.



  • Ajay, you should be able to change the default text editor font from the Tools->Options dialog.  On the Environment\Fonts and Colors tab, choose Courier as the font for the text editor.

    For the dark blue colors, I wrote an extension which lets you apply a custom theme.  This previous blog article should get you started:

  • I've not long installed VS2010 and I have to say that the modifications to the text selection colour, while nice in principle, do mess up colour contrast. Noah's extension does sort out the issues with multiple foreground colours but the semi transparent selected text background is still an issue. If you have anything other than a white (or light) background colour in the editor you simply can't get a light selected text background colour due to the semi-transparency of the selected text region! If I select white for the selected text background colour I end up with a dirty grey.

    Does anyone have any suggestions/any way of reverting to VS2008 behaviour?


  • I use white foreground with black background. In VS2008 I used white background selection with black foreground - the inverse, so everything looked nice. Now with this what selection background should I use? White isn't working well :(

  • I installed the suggested plug-in and it's not really working. I set white as the background but it is not white but gray-ish. Also I have weird blocks at tab distances and 'enter' characters are showing up with dark-gray color. The entire thing looks pretty ugly now :(

  • like peter, i also use high-contrast colors (white fg, black bg) and have similar issues.  maybe the best thing is to provide an option to have vs2008-style selection colors...

  • Well, I also have a small problem with this: if I set the font for some item to have a background color, than that color overrides selection background color, so I can't see what I am selecting. I think that when setting the background color for text, the color of selection should be highest priority (especially since it can only be seen in the background color).

    Also in a later version, like other items can have their background set to "default", so could the selection foreground be set to "default" in factory settings, and could be set by those that want to, as a compromise for those who want it that way.

  • It trully sucks. I love when some bright heads have an idea and thinks everybody should jump into it, and forces them to use their new shinning idea.

    Everytime I upgrade a microsoft app I have to spend days to get it working like I'd like to.

  • except i cant see it. its crap. i am searcxhing all over the place looking for text. maybe i am colour blind or something, but the find feature is now freakin unusable to me cos it is so faint this default gray shading that it is not possible to find it!

  • @dan:  We've changed high contrast to use a 100% opaque selection color for the next release.  You won't see this in VS 2010, but it should be better in

    @Jason:  You can customize the color to be darker.  In Tools->Options->Environment->Fonts and Colors, the default blue is the "Selected Text" color and the default light gray is "Inactive Selected Text".  Also, there is a known bug (fixed for that causes us to use the gray color in XAML files, but for all other file types Find should be using the active blue color, not the inactive light gray.  Is that consistent with what you're seeing?  If the gray is showing up in non-XAML files, we'd like to investigate.

    - Brittany

  • This really sucks (sorry to have to say this). We're just looking at migrating to VS2010 and it seems you've messed up everything which I'd like to be able to configure - this is just one example, i.e. the way the new 'Fonts and Colors' is working.

    I see two things, which seems to be a blatant misunderstanding of how at least some of us developers like to work. First of all this new feature to be able to see syntax coloring in selection (and thus disabling "Item foreground" for "Selected Text") adds absolutely nothing to me. Why not have this 'invention' as a user choice (isn't this what "Automatic" could mean), so that we don't have to rely on secondary tools like "Selection Foreground".

    But most importantly you're now also saying that "Item background" is meaningless for all other items, at least this is what it is in practice if you want to be able to use selection. Without "Selection Foreground" you could not see a selection you made. Now this tool makes it bearable, but not perfect. I don't know if this is a bug or just something you thought was a good idea, but "Item background" for "Selected Text" (and "Inactive Selected Text") does not take precedence over other items' "Item background" when they are set. This is what made it impossible to see a selection.

    What I want personally, is selections to be plain white on black (like an invert for normal text) - but this should be for all items (regardless of their respective settings).

    I hope you're still reading these comments and can make updates to this effect or make someone write a "Selection Background Override" tool as well (or show us how).


Page 2 of 3 (40 items) 123