This course - Enabling Visual Styles (also known as XP Themes)

last updated: 08/07/2006

Visual Styles, a.k.a. XP themes, can be enabled in .NET v2.0 by adding the following code to your Main() method (copy from this plain text file).  XP themes can product the following look and feel (left side below) as opposed to without (right side below):

    // enable XP theming (a.k.a. "visual styles"),
    // but only if newer OS and the feature is available
    if ((Environment.OSVersion.Version.Major >= 5) &&
        (Environment.OSVersion.Version.Minor > 0))
    {
       if (OSFeature.Feature.IsPresent(OSFeature.Themes))
       {
          Application.EnableVisualStyles();
       }
    }