OSFeature.LayeredWindows 字段

定义

表示分层的、顶级窗口功能。 此字段为只读。

C#
public static readonly object LayeredWindows;

字段值

示例

以下示例确定当前系统是否支持分层窗口。 基类方法 IsPresent 被调用 作为 LayeredWindows 要查找的功能。 结果显示在文本框中。 此代码假定 textBox1 已实例化并放置在窗体上。

C#
private void LayeredWindows() {
   // Gets the version of the layered windows feature.
   Version myVersion =
       OSFeature.Feature.GetVersionPresent(OSFeature.LayeredWindows);

   // Prints whether the feature is available.
   if (OSFeature.Feature.IsPresent(OSFeature.LayeredWindows))
      textBox1.Text = "Layered windows feature is installed.";
   else
      textBox1.Text = "Layered windows feature is not installed.";
}

注解

操作系统可将分层窗口设为透明或半透明。 Windows 2000 中首次引入了对分层窗口的支持。

若要确定是否安装了分层 Windows 功能,请使用 Feature 属性调用基类方法IsPresentLayeredWindows,作为要查找的功能。

或者,可以通过调用 GetVersionPresent 方法来检查来查看是否安装了该功能,并将 LayeredWindows 作为要查找的功能。

适用于

产品 版本
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

另请参阅