Event handling

  • Thread starter Thread starter kdbarrett
  • Start date Start date
K

kdbarrett

I have code that dynamically creates checkboxes at runtime. How can I
capture events from those checkboxes?

Thanks
 
Hi man,
when in your code at rine-time initialize the checkBox initialize the even
as well!! and add the box1 in an ArrayList
CheckBox box1 = new CheckBox();

box1.CheckedChanged +=new EventHandler(box1_CheckedChanged);

CheckBoxArray.Add (box1)



also, make the box1_CheckedChanged (object Sender, System.EventArgs e)

in this method cast the sender and find the checkBox in the arrayList and
what must be done

Hope that Helps
 
I can't seem to get this to work. Can you point me to a more detailed
example? Thanks!
 
Back
Top