WPF Message Box doesn’t use Visual Styles

When you run WPF message box, by default here’s the output:

image

To fix this, In Visual Studio 2010

1. Add new item –> Application Manifest file

2. Uncomment the following lines:

   <dependency>
    <dependentAssembly>
      <assemblyIdentity
          type=”win32″
          name=”Microsoft.Windows.Common-Controls”
          version=”6.0.0.0″
          processorArchitecture=”*”
          publicKeyToken=”6595b64144ccf1df”
          language=”*”
        />
    </dependentAssembly>
  </dependency>

3. In project properties, Debug tab, uncheck “Enable Visual Studio Hosting Process”.

Below is the updated output:

image

References:

http://www.nbdtech.com/Blog/archive/2008/05/28/Why-am-I-Getting-Old-Style-File-Dialogs-and-Message.aspx#64

http://learnwpf.com/post/2007/01/05/Why-does-the-OpenFileDialog-in-WPF-look-so-e2809c1999e2809d-and-how-can-I-fix-it.aspx

http://www.nbdtech.com/Blog/archive/2008/06/16/The-Application-Manifest-Needed-for-XP-and-Vista-Style-File.aspx

 

 
 
 
About these ads

About vijayvepa

I'm a software consultant for Software Specialists Inc. currently working at Philips Respironics, Pittsburgh

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: