Monday, November 15, 2010

Visual Studio 2008 – Garbled Text in XAML View

November 15, 2010 Posted by Jason Irwin , 1 comment

Since switching to Windows 7 on my work laptop I've had pretty constant issues with the XAML designer in Visual Studio 2008. Essentially, when I scroll through the XAML code the text becomes garbled and near impossible to read. Switching back and forth between views works, but is a dirty, frustrating and somewhat time-consuming solution. It is also one of those things that works fine on everyone else's computer (to be honest I'm still not sure why) and is difficult to find appropriate keywords for when searching online.

 

garbledtext


This morning I came across an issue logged on Microsoft's connect page (http://connect.microsoft.com/VisualStudio/feedback/details/465834/visual-studio-2008-xaml-editor-doesnt-paint-properly) with similar symptoms to my own. In the comments section Mark Wilson-Thomas (of the WPF and Silverlight team) suggested doubling the number of available GDI handles - which is defaulted to 10,000 on Windows 7.

So, I updated the following registry key DWORD value from 2710 hex (10,000 decimal) to 4e20 (20,000 decimal)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\GDIProcessHandleQuota

I then restarted VS2008 and, voila, no more garbled text. Happy days!

1 comments:

Anonymous said...

Thanks for the tip -- had this problem when using Visual Studio 2008 and also 2010 when writing VB.NET or C# code. So far so good! Note: I usually have a lot of tabs opened in Firefox and I notice they use quite a few GDI objects and usually all my Windows for any apps go crazy, e.g., borders around opened windows go black, bit color drops from 32 bit to 16 bit, when I have over 50 tabs opened. Thanks so much for the post and solution!