PropertyDescriptorCollection.Find(String, Boolean) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
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
반품
지정된 이름의 A PropertyDescriptor 이거나 null 속성이 없는 경우입니다.
예제
다음 코드 예제에서는 특정 PropertyDescriptor을 찾습니다. 텍스트 상자에 이 PropertyDescriptor 구성 요소의 형식을 인쇄합니다. 이를 요구 button1 하며 textBox1 양식에서 인스턴스화되었습니다.
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;
}
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