Announcement

Collapse
No announcement yet.

Control Button Events / Properties auslesen

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Control Button Events / Properties auslesen

    VS2008SP1

    Möchte die Events eines Buttons auslesen das zuvor
    auf einer Form angelegt wurde. Das Event ist z.B. MouseDown
    und dort steht z.B. Geklickt
    Wie geht das ?.
    Vielen Dank.

    Code:
    foreach (Control c in ctls)
    {
           string s = c.Parent.Name.ToString();
           string sText=c.Text;
           
           string sProcedure = c.MouseDown.Text;  // ?????
    
    }

  • #2
    Code:
    Type myObjectType = typeof(MyForm.MyButton)
    
    // oder Button auch über Reflexion zu finden
    
    System.Reflection.EventInfo[] eventInfo =
       myObjectType.GetEvents();
    
    foreach (System.Reflection.EventInfo info in eventInfo)
       Console.WriteLine(info.Name);
    Bitte vergessen Sie nicht die Antwort zu bewerten. Danke.:-)

    Comment

    Working...
    X