OSFeature.LayeredWindows OSFeature.LayeredWindows OSFeature.LayeredWindows OSFeature.LayeredWindows Field

定义

表示分层的、顶级窗口功能。Represents the layered, top-level windows feature. 此字段为只读。This field is read-only.

public: static initonly System::Object ^ LayeredWindows;
public static readonly object LayeredWindows;
 staticval mutable LayeredWindows : obj
Public Shared ReadOnly LayeredWindows As Object 

字段值

示例

下面的示例确定当前系统是否支持分层窗口。The following example determines whether the current system supports layered windows. IsPresentLayeredWindows作为要查找的功能调用基类方法。The base class method IsPresent is called with LayeredWindows as the feature to look for. 结果将显示在文本框中。The result is displayed in a text box. 此代码假定textBox1已被实例化并放置在窗体上。This code assumes textBox1 has been instantiated and placed on a form.

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.";
      }
   }
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.";
}

Private Sub LayeredWindows()
    ' Gets the version of the layered windows feature.
    Dim myVersion As Version = _
       OSFeature.Feature.GetVersionPresent(OSFeature.LayeredWindows)
       
    ' Prints whether the feature is available.
    If OSFeature.Feature.IsPresent(OSFeature.LayeredWindows) Then
        textBox1.Text = "Layered windows feature is installed."
    Else
        textBox1.Text = "Layered windows feature is not installed."
    End If
End Sub

注解

操作系统可以使分层窗口透明或半透明。A layered window can be made transparent or translucent by the operating system. Windows 2000 中首次引入了对分层窗口的支持。Support for layered windows was first introduced in Windows 2000. 有关详细信息, 请参阅 "分层窗口:中的平台 SDK 文档http://msdn.microsoft.com中的一种在 Windows 应用程序中使用半透明度和透明度效果的新方法。For more information, see the "Layered Windows: A New Way to Use Translucency and Transparency Effects in Windows Applications" in the Platform SDK documentation at http://msdn.microsoft.com.

若要确定是否安装了分层窗口功能, 请使用Feature属性来调用基类LayeredWindows方法IsPresent , 作为要查找的功能。To determine if the layered windows feature is installed, use the Feature property to call the base class method IsPresent with LayeredWindows as the feature to look for.

或者, 你可以通过调用GetVersionPresent方法来检查是否安装了该功能, 并LayeredWindows将作为要查找的功能。Alternatively, you can check to see if the feature is installed by calling the GetVersionPresent method with LayeredWindows as the feature to find.

适用于

另请参阅