1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| private void Proc_click_btn_ajout_user(object sender, EventArgs e) //Procédure executée lors du clic sur bouton ajout user
{
Table t=new Table();
TableRow r;
TableCell c;
foreach(string user in new String[]{"A","B","C","D"})
{
r=new TableRow();
c=new TableCell();
c.Text=user;
r.Cells.Add(c);
c=new TableCell();
Button Suppr_user = new Button();
Suppr_user.Text = "Suppr";
Suppr_user.ID = user;
Suppr_user.Click += new System.EventHandler(this.Proc_click_Suppr_user); //appel de la procédure Proc_click_btn_visible lors du click sur un bouton
c.Controls.Add(Suppr_user);
r.Cells.Add(c);
t.Rows.Add(r);
}
this.Form.Controls.Add(t);
}
private void Proc_click_Suppr_user(object sender, EventArgs e) //Procédure executée lors du clic sur bouton suppr user
{
label_bienvenu.Text += "test" // test pour vérifier si le code de mon bouton est executé
} |
Partager