Aracılığıyla paylaş


EventDescriptorCollection.Find(String, Boolean) Yöntem

Tanım

Koleksiyonda belirtilen ada sahip olayın açıklamasını alır.

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

Parametreler

name
String

Koleksiyondan alınacak olayın adı.

ignoreCase
Boolean

true olayın büyük/küçük harf durumunu yoksaymak istiyorsanız; aksi takdirde , false.

Döndürülenler

EventDescriptor belirtilen ada sahip veya null olay yoksa.

Örnekler

Aşağıdaki kod örneği belirli EventDescriptorbir bulur. Bunun için EventDescriptor bileşen türünü bir metin kutusuna yazdırır. Bunu gerektirir button1 ve textBox1 bir formda örneklenmiştir.

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

Açıklamalar

Uyarı

Bu HostProtectionAttribute sınıfa uygulanan öznitelik şu Resources özellik değerine sahiptir: Synchronization. HostProtectionAttribute masaüstü uygulamalarını etkilemez (genellikle bir simgeye çift tıklayarak, komut yazarak veya bir tarayıcıya URL girerek başlatılır). Daha fazla bilgi için bkz HostProtectionAttribute . sınıf veya SQL Server Programlama ve Konak Koruması Öznitelikleri.

Şunlara uygulanır

Ayrıca bkz.