c# - How to add event handler for dynamically created controls at runtime? -


i working on c# windows application. application controls(button,text box,rich text box , combo box etc)from custom control library , placed them form dynamically @ run time. how create event handler controls using delegate? , how add business logic in particular custom control click event?

for example:

i have user1, user2, user3, when user1 log in want show "save" button. when user2 show "add , delete" buttons , user 3 show "add , update" buttons.text boxes , button created per user log in information taken db tables.in scenario how handle different event(adding,saving,updating,deleting) button save,add,delete , update different users when form dynamically created controls(save,add,delete , update button object same button class)

var t = new textbox(); t.mousedoubleclick+=new system.windows.input.mousebuttoneventhandler(t_mousedoubleclick);  private void t_mousedoubleclick(object sender, mousebuttoneventargs e) {      throw new notimplementedexception(); } 

it's adding double click eventhandler new textbox


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -