PropertyDescriptorCollection.Find(String, Boolean) 메서드

정의

대/소문자를 무시할지 여부를 나타내는 부울 값을 사용하여 지정된 이름의 PropertyDescriptor를 반환합니다.

public:
 virtual System::ComponentModel::PropertyDescriptor ^ Find(System::String ^ name, bool ignoreCase);
public virtual System.ComponentModel.PropertyDescriptor Find (string name, bool ignoreCase);
public virtual System.ComponentModel.PropertyDescriptor? Find (string name, bool ignoreCase);
abstract member Find : string * bool -> System.ComponentModel.PropertyDescriptor
override this.Find : string * bool -> System.ComponentModel.PropertyDescriptor
Public Overridable Function Find (name As String, ignoreCase As Boolean) As PropertyDescriptor

매개 변수

name
String

컬렉션에서 반환할 PropertyDescriptor의 이름입니다.

ignoreCase
Boolean

속성 이름의 대/소문자를 무시하려면 true이고, 그렇지 않으면 false입니다.

반환

지정된 이름의 PropertyDescriptor이거나, 해당 속성이 없는 경우 null입니다.

예제

다음 코드 예제에서는 특정 PropertyDescriptor를 찾습니다. 이 PropertyDescriptor 구성 요소의 형식을 텍스트 상자에 인쇄합니다. 및 가 button1textBox1 양식에서 인스턴스화되어야 합니다.

private:
   void FindProperty()
   {
      // Creates a new collection and assign it the properties for button1.
      PropertyDescriptorCollection^ properties = TypeDescriptor::GetProperties( button1 );
      
      // Sets a PropertyDescriptor to the specific property.
      PropertyDescriptor^ myProperty = properties->Find( "Opacity", false );
      
      // Prints the property and the property description.
      textBox1->Text = myProperty->DisplayName + "\n" + myProperty->Description;
   }
private void FindProperty() {
   // Creates a new collection and assign it the properties for button1.
   PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(button1);

   // Sets a PropertyDescriptor to the specific property.
   PropertyDescriptor myProperty = properties.Find("Opacity", false);

   // Prints the property and the property description.
   textBox1.Text = myProperty.DisplayName + '\n' + myProperty.Description;
}
Private Sub FindProperty()
    ' Creates a new collection and assign it the properties for button1.
    Dim properties As PropertyDescriptorCollection = _
       TypeDescriptor.GetProperties(button1)
       
    ' Sets a PropertyDescriptor to the specific property.
    Dim myProperty As PropertyDescriptor = properties.Find("Opacity", False)
       
    ' Prints the property and the property description.
    textBox1.Text = myProperty.DisplayName & _
       Microsoft.VisualBasic.ControlChars.Cr & myProperty.Description
End Sub

적용 대상

추가 정보