XP-Style Controls In Visual Basic 6

This post was imported from an old blog archive, and predates the creation of AdamCaudill.com

This is a quick and dirty overview of how to get those ever so coveted XP controls in your application. There is a lot of detail I’m leaving out, but you should get the point, if you want more detail a google search or two should give you plenty of info.

Let’s get started….

First you need to make a manifest file, this is just a plain text file that tells Windows how to treat you program. Paste the following into Notepad and save it in the same folder that your program is in, with the name <appname>.exe.manifest (where <appname>.exe is the name of your program, i.e. the manifest for MyGame.exe would be MyGame.exe.manifest).

Now, you’re almost done already! The next step is to bind your program to ComCtl32.dll, if it doesn’t you won’t get the pretty controls. Paste the following code somewhere in your program and call it as soon as your program starts (i.e. in Sub Main), this will ensure that your program actually links to the ConCtl32.dll file before any controls are drawn.

And your done! Enjoy your new fancy controls :p (Note, some controls don’t draw right on there own, if you have a control that doesn’t look right, add a Picture box to your form and move the offending control onto the Picture Box.)