Determines whether the specified or newer version of the specified feature is currently available on the system.
[Visual Basic] Overloads Public Shared Function IsPresent( _ ByVal featureClassName As String, _ ByVal featureConstName As String, _ ByVal minimumVersion As Version _ ) As Boolean [C#] public static bool IsPresent( string featureClassName, string featureConstName, Version minimumVersion ); [C++] public: static bool IsPresent( String* featureClassName, String* featureConstName, Version* minimumVersion ); [JScript] public static function IsPresent( featureClassName : String, featureConstName : String, minimumVersion : Version ) : Boolean;
true if the feature is present and its version is greater than or equal to the specified minimum version; false if the feature is not present or its version is below the specified minimum or if the product containing the feature is not installed.
The following example determines whether version 1.1.1 of the LAYERED_WINDOWS feature of the operating system is present and displays the result in a label. This code assumes Label1 has been placed on the form.
First, a new Version that represents version 1.1.1 is created. Then, IsPresent is called, with OSFeature specifying the class to query for information, LAYERED_WINDOWS specifying the feature to look for, and the Version object representing version 1.1.1 specifying the version to look for. The result of the query is displayed in Label1.
[Visual Basic]
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) ' Declare a VersionNumber. Dim myVersionNumber as VersionNumber ' Create a VersionNumber containing version 1.1.1. myVersionNumber = new VersionNumber(1, 1, 1) ' Determine whether the device context limited feature is present and display the results. Label1.Text = FeatureSupport.IsPresent("System.WinForms.OSFeature", "System.Winforms.OSFeature.LAYERED_WINDOWS", myVersionNumber) End Sub
FeatureSupport Class | FeatureSupport Members | System.WinForms Namespace | FeatureSupport.IsPresent Overload List | GetVersionPresent