private void cmdGroup_Click(object sender, System.EventArgs e) { string strBtnCommand_Click = ((Button)sender).Name; //merci gg00xiv ;) int intNbre_BtnCommand = this.cmdGroup.Controls.Count; for(int i=0; i<=intNbre_BtnCommand-1; i++) { string strBtnCommand_Name = this.cmdGroup.Controls[i].Name; if (strBtnCommand_Click == strBtnCommand_Name) { //On remplacera naturellement ces lignes suivante par l'appel à la fonction //correspondant au bouton. Là c'est paor tester que la valeur de name renvoyée par //sender est bien identique au nom du bouton cliqué. this.textBox1.Text= strBtnCommand_Click; this.textBox2.Text=this.cmdGroup.Controls[i].Name; } } }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question