Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. runtime event handle

runtime event handle

Scheduled Pinned Locked Moved C#
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lucluv
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • L lucluv

      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

      D Offline
      D Offline
      Dan_P
      wrote on last edited by
      #2

      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; ...... ......... } }

      L 1 Reply Last reply
      0
      • D Dan_P

        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; ...... ......... } }

        L Offline
        L Offline
        lucluv
        wrote on last edited by
        #3

        thanks but still its not working.this is a web application.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups