Frans Bouma's blog

Generator.CreateCoolTool();

Syndication

News

    Visit LLBLGen Pro's website

    Follow FransBouma on Twitter

    Add to Technorati Favorites

About me

Fun stuff I created

My work

VS.NET 2003 C# code-editor tip of the day

Three tips actually. All color coding related. Open VS.NET, click Tools - Options and then Environment - Fonts and Colors

  1. Under display items, browse down to Operator. Select 'Maroon' for foreground color and check 'Bold'.
  2. Under display items, browse down to String. Select 'Dark Blue' for foreground color.
  3. Under display items, browse down to Xml Doc Comment. Select 'Custom' for background color and select a very light grey, like RGB 245, 245, 245. Do this also for Xml Tag
Hit OK. Your code will now be more readable, routines are more recognizable, operators are more recognizable.

Published Friday, December 03, 2004 4:00 PM by FransBouma

Filed under:

Comments

# Color Coding in Visual Studio@ Friday, December 03, 2004 6:59 AM

TrackBack

# re: VS.NET 2003 C# code-editor tip of the day@ Friday, December 03, 2004 10:16 AM

Nice, but strings are always pink for me, strings should just be pink. Don't know why though ;)

OmegaSupreme

# re: VS.NET 2003 C# code-editor tip of the day@ Friday, December 03, 2004 10:30 AM

I usually color Numbers and Strings dark blue so that I can see numbers too. :)

David Stone

# re: VS.NET 2003 C# code-editor tip of the day@ Friday, December 03, 2004 10:40 AM

Pink? You used too much frontpage! ;)

Ah I forgot numbers, good tip.

Frans Bouma

# re: VS.NET 2003 C# code-editor tip of the day@ Friday, December 03, 2004 10:41 AM

Strings I show with light grey background.

Operators with RED but only for C# since in VB it doesn't work and is still not fixed for Whidbey so go vote VB devs reading Frans's blog (how many do you think there are) :-)
http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=9497e417-5f3c-4813-988f-0a52546fd301

Daniel Moth

# re: VS.NET 2003 C# code-editor tip of the day@ Friday, December 03, 2004 3:38 PM

While you're there, give ProFont a try.
http://www.tobias-jung.de/seekingprofont/

Rob

# re: VS.NET 2003 C# code-editor tip of the day@ Friday, December 03, 2004 4:00 PM

I always use a black background:

Text = White
Function Calls And Operators = Yellow (Bold)
Strings = Lime
Numbers = Red (Bold)

...Must be from my pascal days - I think. :)

Wayne Barker

# re: VS.NET 2003 C# code-editor tip of the day@ Friday, December 03, 2004 5:08 PM

Frans ....

I tried this in VS2005 - and din't like the super dim xml comments, so I went back in there and hit "Use Defaults" -- and in VS2005 --- I got VS2003 looks back .. LOL .. I've reported this as a bug to MS.

Sahil Malik

# re: VS.NET 2003 C# code-editor tip of the day@ Friday, December 03, 2004 9:47 PM

Clearly, you also meant to change the background to the light gray on Xml Doc Tags as well. Otherwise, it just looks goofy...

Matt Berther

# re: VS.NET 2003 C# code-editor tip of the day@ Saturday, December 04, 2004 5:09 AM

Matt: that's what I meant with Xml Tag ;)

Wayne: ieks! TurboPascal!

Frans Bouma

# re: VS.NET 2003 C# code-editor tip of the day@ Saturday, December 04, 2004 4:35 PM

We always colour strings red because their use should be highlighted as they should be localized and not embedded in source files...

James Snape

# re: VS.NET 2003 C# code-editor tip of the day@ Monday, December 06, 2004 2:52 AM

Turbo Pascal rules! :)

And you should definitly try ProFont! I use it all the time, every resolution the code is still readable. In 1024x768, in which I'm currently working in, is also still doable with ProFont.

Dennis v/d Stelt

# re: VS.NET 2003 C# code-editor tip of the day@ Wednesday, December 08, 2004 8:13 AM

I don't like bold fonts in the editor (like you suggest for the operators). VS.NET 2003 has problems with positioning the cursor when I use Lucida Console in an 8pt bold face. Other fonts, like Courier work fine though. Pretty strange...

Ramon de Klein

# re: VS.NET 2003 C# code-editor tip of the day@ Wednesday, December 08, 2004 8:18 AM

Hey Ramon, da's lang geleje! :)

Frans Bouma

# re: VS.NET 2003 C# code-editor tip of the day@ Sunday, December 12, 2004 5:20 PM

Resharper applies some of its own coloring schemes to properties, methods, etc and I find the color distinctions to be very useful.

Nas

# re: VS.NET 2003 C# code-editor tip of the day@ Thursday, December 30, 2004 6:33 AM

I also show the numbers as red..

What kind of colorschema does resharper use? something we can do without resharper?

Thanks
Marco

Marco

# re: VS.NET 2003 C# code-editor tip of the day@ Thursday, December 30, 2004 11:57 AM

Yeah if you code in c# and aren't using ReSharper... I pity you ;) Color scheme is nice... but I just looked and you can't change it in their UI. Don't know how it maps to VS colors. Will post that question to jetbrains.

Dhominator