0

I need some help on how can i put some Event handler on my Button mybtn using code.

 private void button1_Click(object sender, EventArgs e)
 {
      Button mybtn = new Button();  
      mybtn.Text = "First"; 

        FlowLayoutPanel flowlayoutpl = new FlowLayoutPanel();
        flp.Controls.Add(mybtn);
        panel.Controls.Add(flowlayoutpl);
 }

Edited by ezekel

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by ezekel
0

You would add something like either of the following statements:

mybtn.Click += new EventHandler(mybtn_Click);
//--or--
mybtn.Click += mybtn_Click;
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.