runtime event handle
-
i have created a button at runtime and want to form click event handling during runtime.coding is like class classname { Button b=new Button(); b.id=....... b.Click += new System.EventHandler(_functionname); ........... ........... ........... private void _functionname(object sender, System.EventArgs e) { Button bb=(Button)sender; string urls; urls=bb.id; ...... ......... } } but it is not working Amit Kumar Katiyar BhanuSoft tech Pvt. Ltd. Noida
-
i have created a button at runtime and want to form click event handling during runtime.coding is like class classname { Button b=new Button(); b.id=....... b.Click += new System.EventHandler(_functionname); ........... ........... ........... private void _functionname(object sender, System.EventArgs e) { Button bb=(Button)sender; string urls; urls=bb.id; ...... ......... } } but it is not working Amit Kumar Katiyar BhanuSoft tech Pvt. Ltd. Noida
Have you added the dynamic control to the parent's controls collection?
class classname { Button b=new Button(); b.id=....... b.Click += new System.EventHandler(_functionname); this.Controls.Add(b); //where 'this' is the parent container. ........... ........... ........... private void _functionname(object sender, System.EventArgs e) { Button bb=(Button)sender; string urls; urls=bb.id; ...... ......... } }
-
Have you added the dynamic control to the parent's controls collection?
class classname { Button b=new Button(); b.id=....... b.Click += new System.EventHandler(_functionname); this.Controls.Add(b); //where 'this' is the parent container. ........... ........... ........... private void _functionname(object sender, System.EventArgs e) { Button bb=(Button)sender; string urls; urls=bb.id; ...... ......... } }