OSFeature.Feature Vlastnost

Definice

static Získá instanci OSFeature třídy pro použití pro dotazy na funkce. Tato vlastnost je jen ke č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 se dotazuje OSFeature na LayeredWindows funkci. Zkontroluje se verze, aby se zjistilo, jestli se jedná nullo , aby se zjistilo, jestli je funkce k dispozici. Výsledek se zobrazí v textovém poli. Tento kód předpokládá, že textBox1 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. Instanci této třídy nelze vytvořit.

Pokud chcete zjistit verzi funkce, zavolejte metodu GetVersionPresent . Chcete-li zjistit, zda je k dispozici funkce nebo konkrétní verze, zavolejte metodu IsPresent a určete funkci, která se má hledat, pomocí identifikátorů funkcí uvedených v této třídě.

Platí pro

Viz také