다음을 통해 공유


EventDescriptorCollection.Find(String, Boolean) 메서드

정의

컬렉션에서 지정된 이름을 가진 이벤트에 대한 설명을 가져옵니다.

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

매개 변수

name
String

컬렉션에서 가져올 이벤트의 이름입니다.

ignoreCase
Boolean

true이벤트의 대/소문자를 무시하려면 다음을 실행합니다. 그렇지 않으면 . false

반품

EventDescriptor 지정된 이름의 이름 또는 null 이벤트가 없는 경우입니다.

예제

다음 코드 예제에서는 특정 EventDescriptor을 찾습니다. 텍스트 상자에 이 EventDescriptor 구성 요소의 형식을 인쇄합니다. 이를 요구 button1 하며 textBox1 양식에서 인스턴스화되었습니다.

private:
   void FindEvent()
   {
      // Creates a new collection and assigns it the events for button1.
      EventDescriptorCollection^ events = TypeDescriptor::GetEvents( button1 );
      
      // Sets an EventDescriptor to the specific event.
      EventDescriptor^ myEvent = events->Find( "Resize", false );
      
      // Prints the event name and event description.
      textBox1->Text = String::Concat( myEvent->Name, ": ", myEvent->Description );
   }
void FindEvent()
{
    // Creates a new collection and assigns it the events for button1.
    EventDescriptorCollection events = TypeDescriptor.GetEvents(button1);

    // Sets an EventDescriptor to the specific event.
    EventDescriptor myEvent = events.Find("Resize", false);

    // Prints the event name and event description.
    textBox1.Text = myEvent.Name + ": " + myEvent.Description;
}
Private Sub FindEvent()
    ' Creates a new collection and assigns it the events for button1.
    Dim events As EventDescriptorCollection = TypeDescriptor.GetEvents(button1)
    
    ' Sets an EventDescriptor to the specific event.
    Dim myEvent As EventDescriptor = events.Find("Resize", False)
    
    ' Prints the event name and event description.
    textBox1.Text = myEvent.Name & ": " & myEvent.Description
End Sub

설명

메모

이 클래스에 적용된 특성에는 HostProtectionAttribute 다음과 같은 Resources 속성 값 Synchronization이 있습니다. 데스크톱 애플리케이션에는 HostProtectionAttribute 영향을 주지 않습니다(일반적으로 아이콘을 두 번 클릭하거나 명령을 입력하거나 브라우저에서 URL을 입력하여 시작됨). 자세한 내용은 클래스 또는 SQL Server 프로그래밍 및 호스트 보호 특성을 참조 HostProtectionAttribute 하세요.

적용 대상

추가 정보