System.Windows.Forms.OSFeature.IsPresent Method

Retrieves a value indicating whether the operating system supports the specified feature or metric.

Syntax

public static bool IsPresent (SystemParameter enumVal)

Parameters

enumVal
A System.Windows.Forms.SystemParameter representing the feature to search for.

Returns

true if the feature is available on the system; otherwise, false.

Remarks

Typically, you use the OSFeature.IsPresent(SystemParameter) method to determine if the operating system supports the specific feature or metric identified by enumValue. Based upon the value returned from OSFeature.IsPresent(SystemParameter), you would perform conditional actions in your code. For example, if calling this method with a parameter value of SystemParameter.FlatMenu returns true, you could create owner-drawn menus in your application in a flat style.

Accessing some system features or metrics can raise exceptions if they are not available on a specific operating system version. In this case, first use the corresponding System.Windows.Forms.SystemParameter enumeration value, along with OSFeature.IsPresent(SystemParameter), to determine if the metric is supported. For example, call OSFeature.IsPresent(SystemParameter) with SystemInformation.CaretWidth before getting the SystemInformation.CaretWidth property value.

Requirements

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