OSFeature.Feature Propiedad

Definición

Obtiene una instancia static de la clase OSFeature que se va a utilizar en las consultas de las características. Esta propiedad es de sólo lectura.

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

Valor de propiedad

Instancia de la clase OSFeature.

Ejemplos

En el ejemplo siguiente se consulta OSFeature la LayeredWindows característica. La versión se comprueba para ver si es null, para determinar si la característica está presente. El resultado se muestra en un cuadro de texto. Este código supone textBox1 que se ha creado y colocado en un formulario.

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

Comentarios

Utilice esta static propiedad para consultar las características del sistema operativo. No se puede crear una instancia de esta clase.

Para determinar la versión de una característica, llame al GetVersionPresent método . Para determinar si hay una característica o una versión específica, llame al IsPresent método y especifique la característica que se va a buscar con los identificadores de características proporcionados en esta clase.

Se aplica a

Consulte también