OSFeature.Feature Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets a static instance of the OSFeature class to use for feature queries. This property is read-only.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public static OSFeature Feature { get; }

Property Value

Type: System.Windows.Forms.OSFeature

An instance of the OSFeature class.

Use this static property to query for operating system features. You cannot create an instance of this class.

To determine the version of a feature, call the GetVersionPresent method. To determine if a feature or a specific version is present, call the IsPresent method and specify the feature to look for with the feature identifiers provided in this class.

The following example queries OSFeature for the LayeredWindows feature. The version is checked to see if it is null, to determine whether the feature is present. The result is displayed in a text box. This code assumes textBox1 has been created and placed on a form.

private void LayeredWindows() {
   // Gets the version of the layered windows feature.
   Version myVersion =

   // Prints whether the feature is available.
   if (myVersion != null)
      textBox1.Text = "Layered windows feature is installed.\n";
      textBox1.Text = "Layered windows feature is not installed.\n";

.NET Framework
Available since 1.1
Return to top