Answers for "dynamic add event control c#"

C#
0

dynamic add event control c#

private void Form1_Load(object sender, EventArgs e)
{
    Button b = new Button();
    b.Click += new EventHandler(ShowMessage);
    Controls.Add(b);
}

private void ShowMessage(object sender,EventArgs e)
{
    MessageBox.Show("Message");
}
Posted by: Guest on October-25-2020

Code answers related to "dynamic add event control c#"

C# Answers by Framework

Browse Popular Code Answers by Language