In Focus

Forums - C# Corner

Forum guidelines
Vishal Deb

Vishal Deb

  • 1.6k
  • 2
  • 2.5k

How to know dynamically created chekboxes is selected or not

May 8 2013 9:40 AM
Hi All

I am trying to generated the dynamic labels depending on the checked checkboxes which are dynamically created.

My .Net frame is 3.5
Here is code for dynamic checkboxes

System.Windows.Forms.CheckBox[] checkBox = new System.Windows.Forms.CheckBox[bran_count];

            for (int i = 0; i < bran_count; ++i)
                checkBox[i] = new CheckBox();
                checkBox[i].Name = "radio" + Convert.ToString(i);
                checkBox[i].Text = ds2.Tables[0].Rows[i][2].ToString();
                checkBox[i].Location = new System.Drawing.Point(125 * i, 15);
                checkBox[i].CheckStateChanged += new System.EventHandler(CheckBoxCheckedChanged);
        private void CheckBoxCheckedChanged(object sender, EventArgs e)
Any guidance is welcome, if possible give some code snippet.

Answers (1)


Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now