OSFeature.LayeredWindows 字段
表示分层的、顶级窗口功能。此字段为只读。
**命名空间:**System.Windows.Forms
**程序集:**System.Windows.Forms(在 system.windows.forms.dll 中)
语法
声明
Public Shared ReadOnly LayeredWindows As Object
用法
Dim value As Object
value = OSFeature.LayeredWindows
public static readonly Object LayeredWindows
public:
static initonly Object^ LayeredWindows
public static final Object LayeredWindows
public static final var LayeredWindows : Object
备注
操作系统可使分层窗口成为透明的或半透明的。Windows 2000 最先引入对分层窗口的支持。有关更多信息,请参见位于 https://www.microsoft.com/china/msdn 上的 Platform SDK 文档中的“Layered Windows: A New Way to Use Translucency and Transparency Effects in Windows Applications”(分层窗口:在 Windows 应用程序中使用透明和透明效果的新方法)。
若要确定是否安装了分层窗口功能,请使用 Feature 属性调用基类方法 IsPresent,调用时将 LayeredWindows 作为要查找的功能。
通过将 LayeredWindows 作为要查找的功能来调用 GetVersionPresent 方法,也可以检查是否安装了该功能。
Windows 2000, Windows 2000 专业版, Windows 2000 Server, Windows 2000 Advanced Server, Windows XP Home Edition、Windows XP Professional x64 Edition、Windows Server 2003 平台说明: 支持分层窗口 API。但请注意,某些显示驱动程序不支持分层。
示例
下面的示例确定当前系统是否支持分层窗口。调用基类方法 IsPresent,调用时把 LayeredWindows 作为要查找的功能。结果显示在文本框内。此代码假定 textBox1
已实例化并放置在窗体上。
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
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 void LayeredWindows()
{
// Gets the version of the layered windows feature.
Version myVersion = OSFeature.get_Feature().GetVersionPresent
(OSFeature.LayeredWindows);
// Prints whether the feature is available.
if (OSFeature.get_Feature().IsPresent(OSFeature.LayeredWindows)) {
textBox1.set_Text("Layered windows feature is installed.");
}
else {
textBox1.set_Text("Layered windows feature is not installed.");
}
} //LayeredWindows
平台
Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition
.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求。
版本信息
.NET Framework
受以下版本支持:2.0、1.1、1.0
请参见
参考
OSFeature 类
OSFeature 成员
System.Windows.Forms 命名空间
IsPresent
GetVersionPresent
Feature