Home » Visual Studio

Cannot print code listings in color from VS 2010

How do I print code listings in color from VS 2010.  I have tried setting the fonts and colors for printing the same as the text editor.  It doesn't work.  I've tried  setting different settings for printing, and it won't print in color.  I have a color printer.

4 Answers Found


Answer 1

Hi Harold,

The short answer is that color  printing is unfortunately not supported for Visual Studio 2010.  However, this is already on our list of features to reconsider during planning for the next release.  If you'd like to vote for color printing to be reinstated in a future version of VS, I'd encourage you to do so here.  The more votes a bug gets, the more likely it is to be fixed in the future.

For now, you can potentially work around the absence of color printing by copying code into another application (e.g. MS Word) for printing.  Visual Studio's RTF copy/paste functionality allows syntax coloring to persist when copying and pasting into another rich text editor like Word, so copying/pasting from VS to Word and then printing from Word should allow you to print your code in color.

Brittany Behrens | Program Manager | Visual Studio Platform - Editor | The Visual Studio Blog | @VSEditor on Twitter 


Answer 2

What defines 'a next release'? Something like VS 2012, or can we expect a patch? Given the superlatives that are normally given on the 'completely reengineered UI' for VS 2010, I would expect the latter....


Answer 3

We don't generally release patches for features, so it's unlikely that we'd ship a hotfix for color  printing.

Brittany Behrens | Program Manager | Visual Studio Platform - Editor | The Visual Studio Blog | @VSEditor on Twitter 


Answer 4

Maybe it's possible to write a macro that copies the code into a (RTF) richtext control or word doc and prints it from there...



I apologize in advanced if this has been covered somewhere already, but I can't seem to find it if it is.

With that said, I'm trying to figure out how to print out source code with the syntax coloring. In Visual Studio 2008, when I would tell it to print a source document, I would get a page off the printer that looked exactly like what I had on the screen. (i.e. comments are green, reserved words are blue, text strings or characters are red, etc...) When I print something out of VS2010 everything is black and white save for the line numbers.

I've gone through the fonts and colors settings in the options, and all the settings for the printer are set to the same thing that the text editor is set to... yet I can't get color coded source to print.

Is this common, or is it just me? If it's not just me, was this intentional or is it a bug?
I don't know if it happens with any of the languages other than C++. I don't code in anything else.

I'm running:
Windows Vista Ultimate x64 SP2, Visual Studio 2010 Ultimate Beta 2 (though the problem was in Beta 1, too), and Visual Studio 2008 Professional, all with the latest updates.

I have verified that my Tools|Options...|Fonts and Colors|Printer options are set the same as the Tools|Options...|Fonts and Colors|Text Editor options, however, when I sent code to a color printer, only the line numbers print in color.  I would also like to be able to Send to OneNote in color.   Any help anyone can give would be appreciated.

John Melkerson  


In VB 2008 (and all previous versions) I was able to print the code directly from the edit window in color.  Now in VB 2010 it only will print in black.  What gives?  How can I get a color printout from the code window (other than copying and pasting it into WORD)?




My code only prints in B/W. Printer has been checked and is fine. Code is displayed in standard colors set by Visual C# 2010 Express. I tried a reinstall with no change. Can ayone suggest a solution.



Just wondering if there is a better way now with SharePoint 2010 to apply custom color coding to custom created columns (ie calculcated columns -- like change the background color of a item row based upon its logic value, like if its greater the 90%, give it a green, if its between 80% and 90% give it a light yellow, etc...) then the below links...



If not, then i'll proceed with the same strategies that applied in MOSS2007 for SP2010. 

... This is just a brainstorming post, looking for new and more creative methods on applying color coding to SP2010. I thought about messing with the XSLT in SPDesigner2010 and changing the color that way...




Hello everybody,

today i have wanted to print some source code from VB 2010 and has been surprised by getting only black & white instead of color ( like in VS 2008 ).

If you also like code printing in color then please vote here: https://connect.microsoft.com/VisualStudio/feedback/details/512714/printing-selections-of-code-in-vs2010-only-print-in-black-and-white-no-colors 


using vb.net/asp.net 2005.

I am trying to set the border color of cells of my datagrid to an HTML color code: #c1c1c1

I have the following and would like to convert it so that it uses my color code and not the text of the color name, does anyone know the syntax?  what I have is:

e.Row.Cells(1).BorderColor = Drawing.Color.Red




When I connect to Team Project, I get the option to select any number of projects.  Team Explorer will then show only those projects that I checked.

However, Source Control Explorer will always show all projects, irrespective of whether they are listed in Team Explorer or not.

What is the background for this and is there a way to make Source Control Explorer in sync with Team Explorer?



I have a WPF app that needs to populate a combo box with a listing of country codes. I have some code that is supposed to loop through the region info installed on the windows box and come up with the listing of country codes installed. It's coming up with 127 countries and my understanding is that the number should be closer to 200. Here is my code, can I get some feedback on whether or not it looks correct?


private List<string> GetCountryListing()
  List<string> countries = new List<string>();

  foreach (CultureInfo ci in System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.AllCultures))
    RegionInfo ri = GetRegionInfo(ci);

    if (ri != null && !countries.Contains(ri.ThreeLetterISORegionName))

  return countries;

private RegionInfo GetRegionInfo(CultureInfo cultureInfo)
  RegionInfo ri = null;

  if ((cultureInfo.CultureTypes & CultureTypes.NeutralCultures) != CultureTypes.NeutralCultures && cultureInfo.LCID != CultureInfo.InvariantCulture.LCID)
    ri = new RegionInfo(cultureInfo.LCID);
  return ri;






When I create a new project under 2010 express by selecting from 'from existing code', the project is created. But if I select 4 different directories, in the solutions explorer i see sources and headers as two folders having all .c and .h files. Is there a way solutions explorer highlight the original directories(folders) from where the files are added ?

eg: if I add files from  folders a/b  a/c a/d/e, all the files are listed in solutions explorer which is a big list. But if solutions explorer showed them as these 3 separate directories under sources and headers, it would have been easier to open/browse files.


When I keep the cursor over a lcoal variable in a function, is it possible that it can highlight that variable all the places its used in the function ?


thank you




Below mentioned line is one of the coding standard rule. Can you please explain me about this rule. What is the advantage of this Fxcop (Coding standards) rule?

Should not used Hexadecimal color values. Should used the color fro  Aqua, Black, Blue, Fichsia, Gray, Green, Lime, Navy, Maroon, Olive, Purple, Red, Silver, Teal, White and Yellow.

Please help me out on the same!!!


Pon Kumar Pandian .T



We have just installed project standard 2010 for our programmers.  They are having problems when printing their files.  for example a 2.7MB file ended up spooling as a 99MB file and took 15 minutes to print.   Microsoft phone support suggested minimising the size of the forms before our guys print them (but i haven't been able to find instructions / advice on how to do this).  Any suggestions?




     I am using Visual Studio 2010. Suddenly the controls in the Toolbox are not appearing. Only few controls under "Visual Basic Power Pack", "Reporting" are listing out. How to bring back the controls in the toolbox?





Hi I have started using Access 2010 and new to this version.  I have created a form and it has few buttons. Now I want to print out form but when I do print priview it does show any of my Buttons in it, why? can any one explain please

Same thing with reports. if is has any button it does not come out in printing.




Clearly I've done something to toggle this, but I don't know what I've done.

My code has always been "color-coded."  Today, it's all monochrome black.  Strings used to be red, keywords used to be blue, comments used to be green.  Now it's all just plain black text.

What did I hit to accidentally toggle this?  How do I "fix it" so that it's like it used to be?



What is the correct way to print an image containing an embedded icc profile?

The way I am trying right now is to:

call DocumentProperties to get the size of a DEVMODE struct call DocumentProperties to get a default DEVMODE set dmICMMethod = DMICMMETHOD_SYSTEM and dmICMIntent = DMICM_CONTRAST call DocumentProperties to merge my settings into the DEVMODE struct call CreateDC with the newly created DEVMODE struct call StartDoc with the hDC call StartPage with the hDC call SetICMMode to enable ICM load an image into a BITMAPV5HEADER where the bV5CSType is set to PROFILE_EMBEDDED and the bV5ProfileData and the bV5ProfileSize is set. bV5Intent is set to LCS_GM_IMAGES draw the image using StretchDIBits clean up


Is this the right way to do it? Does the call to SetICMMode override the value set in the DEVMODE.dmICMMethod? Does the BITMAPV5HEADER.bV5Intent override the DEVMODE.dmICMIntent? Should this give the same output as Photoshop when color handling in Photoshop is set to "Printer manages colors"?

Access2007; am scratching my head in puzzlement as to why a color report prints in B&W only....... is in color in print preview

I open another Access2007 app , same PC, same printer...and its color report prints in color....trying to head off the inevitable question about the printer and its driver.....

Is there an option I somehow triggered?  have never seen this before.....kind of perplexed....



Can anybody help me on "HOW TO PRINT RICHTEXTBOX WITH MULTIPLE FONT SIZE AND COLOR". I mean print out hard copy exactly what we see in richtextbox.

Please help me....



I want user to be able to click print button and it will print document in web page.
I try to use window.print(); but it prints everything including transparent font color. I want to print document without printing transparent object. How can I do this?? 


Hi All,

When Im printing my dataview the background color does not print.


Any advice






<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure