Язык

OSFeature.Feature Свойство

Определение

static Возвращает экземпляр OSFeature класса, который будет использоваться для запросов компонентов. Это свойство доступно только для чтения.

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

Значение свойства

Экземпляр класса OSFeature.

Примеры

В следующем примере запрашивается OSFeature функция LayeredWindows . Версия проверяется, есть ли она null, чтобы определить, присутствует ли эта функция. Результат отображается в текстовом поле. В этом коде textBox1 предполагается, что он был создан и помещен в форму.

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

Комментарии

Используйте это static свойство для запроса функций операционной системы. Невозможно создать экземпляр этого класса.

Чтобы определить версию функции, вызовите GetVersionPresent метод. Чтобы определить, присутствует ли компонент или определенная версия, вызовите IsPresent метод и укажите функцию для поиска с идентификаторами компонентов, предоставленными в этом классе.

Применяется к

См. также раздел