OSFeature.Feature Vlastnost
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
static Získá instanci OSFeature třídy, která se má použít pro dotazy na funkce. Tato vlastnost je pouze pro čtení.
public:
static property System::Windows::Forms::OSFeature ^ Feature { System::Windows::Forms::OSFeature ^ get(); };
public static System.Windows.Forms.OSFeature Feature { get; }
static member Feature : System.Windows.Forms.OSFeature
Public Shared ReadOnly Property Feature As OSFeature
Hodnota vlastnosti
Instance třídy OSFeature
Příklady
Následující příklad dotazů OSFeature na LayeredWindows funkci. Verze je kontrolována, aby se zjistilo, zda je null, aby bylo možné určit, zda je funkce přítomna. Výsledek se zobrazí v textovém poli. Tento kód předpokládá textBox1 , že byl vytvořen a umístěn ve formuláři.
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 ( myVersion != nullptr )
{
textBox1->Text = "Layered windows feature is installed.\n";
}
else
{
textBox1->Text = "Layered windows feature is not installed.\n";
}
}
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 (myVersion != null)
textBox1.Text = "Layered windows feature is installed.\n";
else
textBox1.Text = "Layered windows feature is not installed.\n";
}
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 (myVersion IsNot Nothing) Then
textBox1.Text = "Layered windows feature is installed." & _
ControlChars.CrLf
Else
textBox1.Text = "Layered windows feature is not installed." & _
ControlChars.CrLf
End If
End Sub
Poznámky
static Tato vlastnost slouží k dotazování na funkce operačního systému. Nelze vytvořit instanci této třídy.
Pokud chcete určit verzi funkce, zavolejte metodu GetVersionPresent . Chcete-li zjistit, zda je k dispozici funkce nebo konkrétní verze, zavolejte metodu IsPresent a určete funkci, kterou chcete vyhledat pomocí identifikátorů funkcí uvedených v této třídě.