XP manifest files

Even though Windows XP supports skinnable interfaces, Visual Basic 6 applications will not automatically inherit the new look and feel. This is not surprising, considering VB6 has been around long before Windows XP came out. What is surprising though, is that your VB.NET applications also will not automatically inherit the new look.

However, making your buttons, textboxes and other controls look like they were designed for Windows XP is not only possible, it's pretty easy too. The Microsoft API allows this via the use of an XML "manifest" file and a little bit of simple coding.

Firstly, create a manifest file that looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
   manifestVersion="1.0">
<description>Windows forms common control manifest</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32"
   name="Microsoft.Windows.Common-Controls"
   version="6.0.0.0" processorArchitecture="x86"
   publicKeyToken="6595b64144ccf1df" language="*" />
</dependentAssembly>
</dependency>
</assembly>

Save the manifest file, with a ".manifest" extension, in the same directory where the application executable lives. For instance, if your application is called "magarac.exe", then the correct manifest file name would be "magarac.exe.manifest"

Secondly, depending on whether you're using VB.NET, or Visual Basic 6:

In VBN, you must change the flatstyle property of every button, checkbox, groupbox, radio and label from the default "standard" to "system".

In VB6, you must initialise the common controls (via an API call) for every form, before the form becomes visible:

Private Declare Function InitCommonControls _
   Lib "Comctl32.dll" () As Long
Private Sub Form_Initialize()
   InitCommonControls
End Sub

You can even incorporate a manifest file in your IDE. Just create it as one of the following:

  • VBN: C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.exe.manifest
  • VB6: C:\Program Files\Microsoft Visual Studio\VB98\vb6.exe.manifest

Of course, that's assuming you've installed your IDE in those directories. The main thing to remember is that the manifest file must be in the same directory as the application executable.

For an in-depth look at skinning under Windows XP, see Using Windows XP Visual Styles.

Due to the large volume of spam, comments are disabled. If you have anything relevant to say, you can leave a , or contact me directly.

About the author

Ivan's mugshotI'm Ivan Lutrov and I'm the owner of Lutrov Interactive. I have 25 years of experience producing interactive work and I create cost effective business websites that are simple, engaging and easy to use. I practice what I preach and I say what I really think, even if it's sometimes not what you want to hear. Subscribe to the Lutrov Interactive feed via RSS and follow me on Twitter.