Manifest schmanifest…
Published 10.10.2005 by ~mattg
So, I searched for enabling XP Visual Styles in .NET apps on Google. I found LOADS of articles dealing with creating manifest files and adding them as resources to your executable (after building the exe’s). But I found that fishy, as I remember applying XP styling to C1Live (ComponentOne’s Live Update Utility that I started initial development of) without having to create manifest files.
So I retraced some steps and found that the manifest method was required for the .NET Framework version 1.0, however, version 1.1 introduced a method to enable the visual styles without going through all that crap:
This call replaces the creation and inclusion of manifest files for the application. The call needs to be made prior to any creation or initialization of UI elements (I’ve placed it as the first line of the Main function for the app).
NOTE: For controls which inherit from ButtonBase, you have to force them to use the XP Visual Styles by setting the FlatStyle property to System. Always a helpful hint, as buttons are typically the first place I look to see if the changes were effective.
Filed under .NET Development, Windows