0

I wonder whether it is possible to create functions for dynamic items (textboxes, buttons) like

private void Button_Click(object sender, EventArgs e)
private void TextBox_TextChanged(object sender, EventArgs e)

and other?

If yes, then how?

  • I know you can use DynamicalButton.Click(); but that doesn't help much.

EDIT

As example, you can make a function like Button_Click or TextBox_TextChanged, PictureBox_MouseOver easily when you make the objects with designer and they work properly. How to do that with dynamic objects?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

1

Found the answer

DynamicalObject.Click += new EventHandler(DynamicalObject_Click);
protected void DynamicalObject_Click (object sender, EventArgs e)
{
  what happens on the event
}

as example