How to handle events of dynamically added checkbox on windows form

前端 未结 4 876
迷失自我
迷失自我 2021-01-27 02:58

I am able to add checkbox dynamically on windows form and add data value to its text property. On click of any checkbox I have run a procedure which will make certain other chec

4条回答
  •  不要未来只要你来
    2021-01-27 03:24

      private void custom_event_handler(object sender, EventArgs e)
      {
           ....
      }
    

    and then you add checbox like this:

     CheckBox cb = new CheckBox();
     cb.CheckedChanged += new EventHandler(custom_event_hahndler);
    

提交回复
热议问题