OSFeature.Feature Proprietà

Definizione

Ottiene un'istanza static della classe OSFeature da utilizzare per le query sulle funzionalità. Questa proprietà è di sola lettura.

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

Valore della proprietà

Istanza della classe OSFeature.

Esempio

Nell'esempio seguente viene OSFeature richiesta la LayeredWindows funzionalità . La versione viene controllata per verificare se è null, per determinare se la funzionalità è presente. Il risultato viene visualizzato in una casella di testo. Questo codice presuppone che textBox1 sia stato creato e inserito in un modulo.

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

Commenti

Utilizzare questa static proprietà per eseguire una query per le funzionalità del sistema operativo. Non è possibile creare un'istanza di questa classe.

Per determinare la versione di una funzionalità, chiamare il GetVersionPresent metodo . Per determinare se è presente una funzionalità o una versione specifica, chiamare il IsPresent metodo e specificare la funzionalità da cercare con gli identificatori di funzionalità forniti in questa classe.

Si applica a

Vedi anche